0

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?

3
  • What have you tried so far? Have you used the amp-script variables in the input field values? Commented Nov 21, 2018 at 20:34
  • Hello, @codeyinthecloud. I tested an ampscript in the smart capture and another code inside the email content. But i lookup a better workaround. Commented Nov 21, 2018 at 20:41
  • I'm little confused, The way i would do it would be do a lookup against data extension in the cloud page and use those amp script variables in the input fields! Commented Nov 21, 2018 at 21:00

2 Answers 2

4

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.

e.g.

%%[
    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 */
0

The first part of the marked solution actually did not work for me. To use attributes of your sending DE, I used CloudPagesURL with additional parameters. For example:
In your email, use a link with: CloudPagesURL(111, 'parameterName', @parameterValue)

Then in your CloudPage using the QueryParameter function:

   %%[
       set @contactId = QueryParameter('parameterName')
   ]%%

You must log in to answer this question.

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