Is it possible to map two different tokens? | Community
Skip to main content
JohnnyVillarini
New Participant
May 5, 2021
Solved

Is it possible to map two different tokens?

  • May 5, 2021
  • 1 reply
  • 2857 views

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

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-owner/ba-p/302028

1 reply

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
May 5, 2021

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-owner/ba-p/302028

JohnnyVillarini
New Participant
May 5, 2021

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. 

SanfordWhiteman
New Participant
May 6, 2021

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!