0

I've created a simple landing page in Cloud Pages using the new Content Builder editor. I've then created a simple smart capture form for a survey to send to customers. This smart capture form is linked to a DE where responses are stored. EmailAddress is a field within this DE and is the primary key.

I want to be able to link through to a handling page after a customer has completed the form and hit submit at which point, I want to check if the email address entered in the form exists in the responses DE. If it doesn't, it will display a Thank you message. If it does, it will display an error message.

I've tried passing the email address field value using the cloudpageurl ampscript function and the requestparameter ampscript function on the handling page but have had no luck.

On my survey page I have this AMPscript in a content block at the top of the page;

%% [
SET @Email = RequestParameter('Emailaddress')
SET @HandlePage = CloudPagesURL(218, 'Emailaddress', @Email) 
]%%

followed by this email field in the smart capture form;

<div class="sc-formfield-input">
<input name="EmailAddress" data-field-type="EmailAddress" data-validation="email" required="required" data-validation-message="Please enter an email address." style="height: 30px !important;" type="email">
</div>

On my handle page I then have this AMPscript;

%% [
SET @Email = RequestParameter('Emailaddress')
]%%
Email = %%=v(@Email)=%%

But nothing gets pulled into the email value on the handle page.

bumped to the homepage by Community yesterday

This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

0

I'm not sure if you can do that level of validation using smart capture.

I think what you may need to do is:

  • Create a cloud page with a form, set it up to submit to itself/a handling page.

  • Handle the form processing using ampscript

  • When the form gets submitted; do a look up to see if email address exists already, if it does redirect to error page. If it doesn't Insert to DE and then redirect to Thank you Page.

  • Hey Noor. So i know this can't be done using the out the box functionality on smart capture forms but being able to validate on the handling page is what I'm trying to achieve. I know with the old microsites you could use Microsite URL to pass data through from one page to another but for Cloud Pages, I can't seem to do that. – Kai Curtis Apr 13 '18 at 16:18
  • Cloud Pages URL to pass data should work and then using the Request Parameter to retrieve. Is your syntax correct? – Noor Alam Apr 13 '18 at 16:36
  • Added the code i'm using to give more clarity. – Kai Curtis Apr 14 '18 at 8:16
  • Realised we didn't reach a solution on this. If you have the form built using HTML instead of smart capture, in the form action specify the handling page url and method = post. When the survey page loads at that point EmailAddress is null so populating handlepage with the email param will populate it with null instead of the submitted value, so remove the ampscript populating email and handlepage variable in your survey page. – Noor Alam Oct 15 '18 at 10:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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