SOLVED

How to get a token script to display information from Opportunity Object?

Go to solution
Alex_Bridges3
Level 2

Hi all,

I'm trying to create custom token scripts based on items on the opportunity object. However, when I follow the directions here, Create an Email Script Token - Marketo Docs - Product Documentation,​ it doesn't render.

For example, I create a custom token. I call it my.ExampleTokenA. I need it to show the value for Example Opportunity Item A from the Opportunity Object.

When I edit the token, I go to the Opportunity object list, and pick Example Opportunity Item A from the list, and drag it over. So now in my script editor, I see ${OpportunityList.get(0).Example_Opportunity_Item_A}.

However, when I go to test my token, instead of seeing that value, I see ${OpportunityList.get(0).Example_Opportunity_Item_A}. What do I need to do to get it to display the value? No additional formatting is needed; I just need it to display what's there.

Thanks!

1 ACCEPTED SOLUTION
SanfordWhiteman
Level 10 - Community Moderator

Ok, I did more digging on the SFDC side and the stuff is going over okay, there's just not data in those particular fields yet.

Ah, yes, so not a Velocity thing.

So next question - if a field is null, how can I get it to display "---", instead of displaying the script?

$display.alt($OpportunityList[0].Example_Opportunity_Item_A, "---")

View solution in original post

10 REPLIES 10