0

I'm trying to input a field into a smart capture form using the code below for the first content block. I've tried to get this working a number of times and searched here also, similar to the following post, but can't find a solution yet.

Using AMPScript to Pre-Populate a Smart Capture Forms in Salesforce Marketing Cloud

I'm unable to comment on the post above just yet (account is to new).

My script in the content block looks like this:

%%[ var @key, @email, @rowset, @row set @key = QueryParameter("key") set @rowset = LookupRows("DE Name","ContactKey",@key) set @row = Row(@rowset,1) set @email = Field(@row,"EmailAddress") ]%%

Once I click "Schedule/Publish" the page doesn't load in preview, I change the last line of code to this and it works:

set @email = "1"

My DE does have the column named "EmailAddress" and there is a record there, any help would be greatly appreciated. I've tried other columns and also get the same result.

Thanks

  • I am assuming there are proper line breaks in your ampscript code. When you change the code Set @email ="1" , does the smart capture input field display the value? – Praveen Kumar Bandi Jan 24 '18 at 1:52
  • Yes it does input that value "1". Thanks – Steve Jan 24 '18 at 2:00
  • 1
    Thanks for the comment, I've just learnt that the preview won't load when using code. – Steve Jan 24 '18 at 3:02
0

Its ok, the preview won't work. I've published the page and used the lookup and it all works fine.

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.