0

I have a Smart Capture form on my CloudPage for lead generation. The DE it fills is using EmailAddress as the primary key. If the user submitting the form already exists in the DE and they attempt to complete the form, I want to redirect the user to a different URL letting them know they are already subscribed.

Currently, if the user already exists, the form does not submit. The user doesn't know why and it's a bad UX. I think I can use AMPscript to do this, but am fairly new and not sure what the code looks like.

1 Answer 1

0

You can do something like this

%%[SET @emailaddress = RequestParameter("EmailAddress")
SET @isExsistingCustomeremail = Lookup("YourDE","EmailAddress",@emailaddress)

IF(@isExsistingCustomeremail) THEN
//Redirect user to the other url
ELSE
//Upsert the data in your DE]%%
 ENDIF
1
  • Thank you! This was very helpful
    – Nicole
    Commented Jul 15, 2021 at 5:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .