0

In our emails we are using AMPscript to include an ID combined with a URL in an email:

%%[ 
    VAR @ID__c,@landingpage 
    Set @ID__c= ID__c 
    Set @landingpage = Concat('http://cloud.mail.random.com/unsubscribe?Id=',@ID__c) 

]%%

We are experiencing issues rendering the field in the email when using journeys. Our question is whether it is possible to use journey data to fill @ID__c. The field is located in the PersonAccount (contact) object in Salesforce.

We have added the field as an attribute in the profile management and mapped it with the field in Salesforce. This does not work unfortunately.

We have used the following settings for the entry event:

Who:

PersonContact ID (Contact)

Object:

Account

Action:

Created;

Related Objects Criteria:

PersonContact:Contact: OptOutOfMarketing__c equals False

Entry Data:

Account:Id; Account:ID__pc; Account:MasterRecord:Id; Account:MasterRecord:ID__pc; Account:Parent:Id; Account:Parent:ID__pc; Account:PersonContact:Id; Account:PersonContact:Email; Account:PersonContact:HasOptedOutOfEmail; Account:PersonContact:ID__c; Account:PersonContact:LastTransactionDate__c; Account:PersonContact:ResidentialGrouping__c;

1

to use journey data in Ampscript you reference the fields as given in the entry data definition. As salesforce journey entries create a new data extension in the Data Extension folder you can simply cross check in email studio or contact builder how your journey data looks like for script access.

In your case the resulting script should look like this:

%%[VAR @ID, @landingpage    Set @ID = [Account:PersonContact:ID]  Set @landingpage = Concat('http://cloud.mail.random.com/unsubscribe?Id=',@ID)

]%%

I removed the double underscores for your Id variable because it's more likely to cause trouble than help. If the script works and you plan to use it like this, make sure that you update all your references to this variable elsewhere in your email.

| improve this answer | |
  • Thank you so much Stephan. This totally makes sense and is really helpful. – user1122843 Jul 19 '18 at 8:02
  • One last question on this. We are using this piece of AMP script for a send using a DE which refers to the ID as originally created in the DE (ID__c) Is there a way to reference to it in the AMP script part for both the DE and the journey? So 'Account:PersonContact:ID' and 'ID__c' – user1122843 Jul 19 '18 at 8:05

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.