I have this code in AMPSCript in an Email that is an activity in Journey Builder with a Data Entry source as Salesforce Data Entry Event (Order created).

The Salesforce Object is Order and I want to reference just the OrderNumber; for that I am usign this AMPScript code to reference the value:

set @ordernumber = Order:OrderNumber

When going to Preview Test Mode I am receiving this error:

The error message is:

HTML Version There is an error in your email. Please contact your customer service representative. Error 1: Script SET Statement Invalid An error occurred when attempting to resolve a script expression. See inner exception for detail.

Script Expression: Order:OrderNumber

An unrecognized expression appears in a script block. Script Expression: Order:OrderNumber

Invalid Content: set @ordernumber = Order:OrderNumber

Could you please advise me about what am I doing wrong ? Initially, my understanding is that the way to reference Data Entry values from Salesforce Data is in this way.

Thanks a lot in advance, Enrique


When you are using Salesforce data (or any data that has field names including characters such as ":") you need wrap your attribute call in brackets. So your variable declaration should be:

set @ordernumber = [Order:OrderNumber]
| improve this answer | |
  • It works fine now ! Thanks a lot for your help Jason ! – Enrique Diaz Jun 14 '19 at 15:16
  • Glad to help! Can you please mark this as answered? Good luck with your journey set up!! – Jason Hanshaw Jun 14 '19 at 15:19

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.