[SalesForce] The better method to prepopulate a smart capture from data extension

Whats is the better method to prepopulate a smart capture from data extension?

I have a data extension named 'CustomerA' that has the fields: name, lastname, emailaddress, idaccount, genre and date of birth;

I created a landing page with smart capture that has the fields 'name', 'lastname', emailaddress, genre and two dropdown that the subscriber will fill. This Smart Capture will target a data extension named 'Customer-Christmas' and the landing page will send for data extension 'CustomerA';

As i already have the data, i would like to prepopulate the smart capture based in 'CustomerA'. The only method is Ampscript?

Best Answer

The easiest solution would be to have the URL directing your user to the CloudPage to use CloudPagesURL function. This will allow you to pass all the sendable data from your sending DE.

e.g. (in email) <a href="%%=RedirectTo(CloudPagesURL(77))=%%" >yourPage</a>

e.g. (on page) <input type="text" Name="FirstName" value="%%=AttributeValue("FirstName")=%%">

The other option is to use Lookups or LookupRows functions on the CloudPage prior to your form. To do this you will need to pass a subscriberkey or similar unique key to match inside the DE. I would recommend passing this via the CloudPagesURL as shown above. Otherwise you will need to append this to the target url in the link, which will expose it for all to see.


    SET @SubKey = AttributeValue("SubscriberKey")
    SET @FirstName = Lookup('CustomerA', "FirstName", "SubscriberKey", @SubKey)
    SET @LastName = Lookup('CustomerA', "LastName", "SubscriberKey", @SubKey)
    SET @Genre = Lookup('CustomerA', "Genre", "SubscriberKey", @SubKey)
/* If Subkey is not Email then use below to get email */
    SET @EmailAddress = Lookup('CustomerA', "EmailAddress", "SubscriberKey", @SubKey)

<form ...> /* your form content */
<input type="text" name="FirstName" value="%%=v(@FirstName)=%%">
...... /* continued for the rest */
Related Topic