[SalesForce] SmartCapture form not validating & not passing hidden attributes

We want to enrich existing data about customers using a SmartCapture form. So, what we decided is to send an email to the existing customer audience with a link to a CloudPage with the SmartCapture form related to a new & empty data extension in which we would have additional fields such as FirstName, LastName, etc.. Currently, we only have the email address and the FederationID in the campaign audience. Also, as part of the user experience, we would want to pre-populate the email address field and pass the federationID (i.e. Primary Key) as hidden attribute because it does not make sense for the customers to know what their federationID. The end goal is that the SmartCapture form will populate a brand new data extensions (an empty one), and then we would to cross-reference (SQL) the newly enriched data extension with the original audience to which the email was sent via the FederationID.
However, I’m stuck. Here’s what I’ve done.

  • Email

    The email to be sent contains the following code I wrote behind the link to the landing page:

    <p>follow the `%%=RedirectTo(CloudPagesURL(985, 'EmailAddress', EmailAddress, 'federationID', federationID))=%%">link
    
  • Cloud Page – SC form settings

    On the Cloud Page, the SmartCapture form, in the settings, it has under
    "HIDDEN ATTRIBUTES", federationID:

    %%=AttributeValue('federationID')=%%
    

    (so we want to pass federationID as hidden attribute on which we would later on cross-reference the resulting data extensions with the original audience)

  • Email Address as form field (pre-populated)

    While in one of the SC form fields – EmailAddress – it has AMPscript for prepopulating the field (which it works OK):

    value="%%=AttributeValue(' EmailAddress')=%%"
    

Problem:

The problem is that, although when I click on the link in the test email and see that the EmailAddress field is correctly pre-populated, I cannot hit the “Submit” button. In other words, I cannot validate the form (it’s just stuck, I’m not getting the thank-you message), the target data extension is not populated and it seems to me that MC is not passing the federationID value.
How to make the form validate with federationID being passed under hidden attribute?

Best Answer

I had huge problems with SmartCapture forms with AMPScript inside of it and ended up developing my own form and functions to achieve my goal. What I have experienced was:

  1. Problems with JavaScript Functions when you click a submit element that the function popover shows errors and similar cases. (Watch developer console on browsers when you click the element)
  2. AMPScript variables inside hidden fields get purged once saved and the page is reopened. Making the usability just bad. [You have to enter them again and again and again].
  3. Using forms with JavaScript / JQuery and Post/Get events to other website works better and you are not frustrated when salesforce might change something on the smart capture forms.

I really belief that these smart capture forms are bad implemented when you want to use it with ampscript (to fill initial values).

Hope that helps.

Related Topic