2

UPDATEI found the problem. - entrysource Journey = salesforce data event (which automatically creates 2 Example DataExtension with headers = service cloud fields) - from this journey I send the email with the link to the CloudPage - I debugged the code below and the error message said: in order for the ampscript to work, the ID attributes in the sourceDE need to have a maximum # of characters specified - Because the data extension is system generated, it is not possible to change the maximum # of characters for the ID attributes (or delete them)

NEW QUESTION *IT SEEMS CHANGING THE ATTRIBUTE FROM DATA DESIGNER IS TAKING A VERY LONG TIME. IS THERE ANOTHER WAY TO CHANGE THE ATTRIBUTES?**

OLD QUESTION I'm sending an email with a cloudpage link. On that cloudpage smartcapture I want to pre-fill a hidden attribute with the AccountId from that data extension. The data extension name is "2 Example DataExtension", the column header is Account:Id, the subscriberkey column header is Account:PersonContact:Id, subscriberkey is PersonContactId.

%%[var @subscriberKey, @dataSourceName, @subscriberId, @listName, @debug, 
@Id
set @debug = RequestParameter("debug")
set @subscriberKey = AttributeValue("_subscriberKey")
set @dataSourceName = AttributeValue("_DataSourceName")
set @subscriberId = AttributeValue("subscriberid")
set @listName = AttributeValue("_listname")
if empty(@subscriberKey) then
set @Id = ""
else
set @Id = Lookup("2 Example DataExtension", "Account:Id", 
"Account:PersonContact:Id", @subscriberKey)
endif
]%%

The value in the hidden attribute: %%=v(@Id)=%%

The name of the attribute I will be sending the Account:Id to when I click Submit on the SmartCapture is named Id.

What needs to be improved in my code? Thanks in advance!

  • Welcome to SFSE! You are asking X-Y problem. What's your intended purpose? Do you have any issues with your implementation or why do your want to improve it? – Eduard Aug 10 '18 at 7:26
  • I am pre-filling the subscriberkey (PersonContactId), which works fine. But I also want to pre-fill the Account Id, when I try with above code it doesn't work. The goal is to perform an Update Account Object Activity (Journey), therefore I need the Account Id. – J.Nie Aug 10 '18 at 7:48
  • I have tried to execute v() function in the hidden attribute part in smart capture form and it didn't work. Maybe you can create a manual form with HTML and prefill the form fields that you want. – Selim Sevim Aug 10 '18 at 9:59
  • Thank you! I have narrowed it down. - entrysource Journey = salesforce data event (automatically creates 2 Example DataExtension with headers = service cloud fields) - Because the data extension is system generated, it is not possible to change the maximum # of characters for the ID attributes - in order for the ampscript to work, the ID attributes need to have a maximum # of characters specified. I am now trying to edit the max # of characters via data designer, hope that works - – J.Nie Aug 10 '18 at 11:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.