Help with Populating Custom Field from Opportunity
Hello Marketo Community,
I’m running into an issue while trying to populate a custom lead field in Marketo with data from an Opportunity field, and I’m hoping to get some insights or advice from those who may have encountered similar challenges.
What I’m Trying to Achieve:
I’m working on a campaign where I need to copy the nha_wlreapply_link (a URL) from the Opportunity object into a custom lead field called Waiting List Notification - Link Key Value. My goal is to make this data available on the lead record so that I can easily use it in emails and other assets.
Approach Taken So Far:
- I created a Velocity script token to pull the nha_wlreapply_link from the Opportunity object using the following script:
Velocity Script Token:
- I created a Velocity script token to pull the nha_wlreapply_link from the Opportunity object using the following script:
#if($OpportunityList.size() > 0)
${OpportunityList.get(0).nha_wlreapply_link}
#else
No link available
#end
Change Data Value Flow Step:
- I attempted to use this Velocity script token in a "Change Data Value" flow step to populate the Waiting List Notification - Link Key Value field, but it resulted in the field being populated with the entire script as a JSON object rather than the resolved URL.
Issue:
Instead of storing the resolved URL, the custom field Waiting List Notification - Link Key Value ends up with a value that includes the whole script and its associated metadata in JSON format.
What I’ve Learned:
I now understand that Velocity script tokens may not work as intended in flow steps like "Change Data Value" because Marketo might not process them correctly in this context.
Question to the Community:
Has anyone successfully populated a custom lead field from an Opportunity field using a method that works in a flow step, particularly in cases where the Opportunity field isn’t directly available as a token? Is there a workaround or best practice that can achieve this without resorting to Velocity scripts in flow steps?
Any advice, tips, or alternative approaches would be greatly appreciated!
Thank you in advance for your help!