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?

  • What have you tried so far? Have you used the amp-script variables in the input field values? – codeyinthecloud Nov 21 '18 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. – Joao Marano Nov 21 '18 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! – codeyinthecloud Nov 21 '18 at 21:00
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 */

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.