Is there a way to control a journey's flow based on if the record is new or an existing Specifically, I'm using a Cloud Page form as an entry source.

Here's my use case: A user fills out a Cloud Page form and clicks submit. My existing journey sends them an email thanking them for subscribing. However, if the user already exists, and they fill out the form again, I would like to send them a different email notifying them that they've updated their info.


You can definitely do it in several approaches but here is my suggestion:

  1. Create two new nullable Boolean fields in the Entry Source Data Extension, let's call them FormSubmitted and FormUpdated
  2. Add the logic on the CloudPage that once the form is submitted, you populate one of these fields with True value. So it going to be if FormSubmitted is empty, then populate it with True value and if already populated then FormUpdated gets True value -
/* You need to identify the SubscriberKey in advance though */
SET @Lookup = Lookup("Entry_Source_DE", "FormSubmitted", "SubscriberKey", @SubscriberKey)

    SET @UpdateData = UpdateData("Entry_Source_DE", 1, "SubscriberKey", @SubscriberKey, "FormSubmitted", "True")
    SET @UpdateData = UpdateData("Entry_Source_DE", 1, "SubscriberKey", @SubscriberKey, "FormUpdated", "True")
  1. Next, in the Journey, you add Decision Split, which would split the audience into two paths: first one - FormSubmitted = True and second one FormUpdated = True (remember to create an Attribute Group with the Entry Source Data Extension in advance)
  2. Add different Email Activities into each path, where FormSubmitted = True is for first submitters and FormUpdated = True is for contacts that submitted at least twice.

Some documentation links - AMPscript Lookup and UpdateData functions and then how to set up Dicision Split in the Journey.

  • + remember to choose the contact data instead of journey data while adding decision split Jul 8 at 18:47
  • This may be another question to submit, but what if I only want to display a message on the landing page for records that already exist (no email/journey), and send an email for new records? Jul 8 at 21:45
  • Then again you would have some AMPscript that would work via Lookup into the Entry Source DE to see if the record already exists and based on the result display needed message. You would wrap your ‘HTML’ with AMPscript IF, ELSE, ENDIF conditions.
    – Niko
    Jul 9 at 5:40
  • I placed the lookup and update code above the <HTML> tag of the landing page and an error was returned. I did try a simple variable and that worked, but for some reason the lookup code does not work. I've updated lookup and update arguments with my specific DE. Jul 9 at 17:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.