My company has two custom tokens in Marketo that are used to display our sales owner's calendar link. One token is for leads while the other is for contacts, but they both have the same values depending on the sales owner (formula field in Salesforce so doesn't sync automatically). My Salesforce Admin has said that those fields are allowed to be mapped on the Salesforce end, but in order for my team to use these tokens efficiently, I will have to segment the lists based on leads versus contacts from what I know.
Is it possible to map these two tokens together in Marketo so that we only have to send one email instead of segmenting the lists and sending two? There must be a way to do this with dynamic content that I am just not aware of at the moment.
Solved! Go to Solution.
Are you asking "Can I output one of 2 fields, whichever has a value?"
Because that can be done in Velocity. See https://nation.marketo.com/t5/product-blogs/displaying-account-owner-info-if-it-s-present-and-person...
Are you asking "Can I output one of 2 fields, whichever has a value?"
Because that can be done in Velocity. See https://nation.marketo.com/t5/product-blogs/displaying-account-owner-info-if-it-s-present-and-person...
Yes exactly, that looks like it would work. I'm not too familiar with Velocity tokens, unfortunately, would that be created within the email program under my tokens, or would this need to be created in the email code or would it live elsewhere?
Update: I see it has to be done in the My Tokens - Edit Script Token. I tested the token below but it gave me an error when I tried to test it.
## @requires-object-fields
## ${lead.Lead_Owner_RingDNA_Calendar_Link__c}
## ${lead.RingDNA_Calendar_Link__c}
##
##
#if( !${lead.Lead_Owner_RingDNA_Calendar_Link__c}.isEmpty() )
Owned at Lead level by ${lead.Lead_Owner_Email_Address} <${lead.Lead_Owner_RingDNA_Calendar_Link__c}>
#elseif( !${lead.RingDNA_Calendar_Link__c}.isEmpty() )
Owned at Contact level by ${lead.Lead_Owner_Email_Address} <${lead.RingDNA_Calendar_Link__c}>
Basically what I am trying to do is show our token - "Lead Owner RingDNA Calendar Link" on the lead level, only if the "RingDNA Calendar Link (C)" on the contact level doesn't exist/is empty.
You're missing an #end there. That's a fatal syntax error.
Also, my code emphatically does not use ${formal} references. Please follow my style and use $simple references!
This is awesome wow thank you Sanford. One last question, the tokens are displaying with the correct value but with < > around it, since I used < and > I thought it would take it away but it hasn't. Do you know if < and > need to be added elsewhere?
Update: I just had to take out < and > lol. Thanks again! I will definitely be using this for future customization
Update: I just had to take out < and > lol. Thanks again! I will definitely be using this for future customization
Yep, that's what I was gonna suggest. 🙂