Sure.
The form collects names and email addresses. When the user clicks the submit button there are 3 completion events.
1. Dynamic SQL Statement: If the user's email address has not already been entered in our database table, it is added. This is a
if (select count(email) from myTable where email='$(Email)')=0
INSERT INTO {databaseOwner}[{objectQualifier}NewsletterSubscribers]([UniqueCompletionID],[ResponseDateTime],[UserID],[IPAddress],[FirstName],[LastName],[Email],[State])VALUES ('$(UniqueCompletionID)',GetDate(),$(UserID),'$(IPAddress)','$(FirstName)','$(LastName)','$(Email)','$(State)')
2. Email Event. I'd like to send the email only if the first event resulted in a database insert
3. Redirect Event. This one always redirects.