SOLVED

Is it possible to map two different tokens?

Go to solution
JohnnyVillarini
Level 2

Is it possible to map two different tokens?

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.

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Is it possible to map two different tokens?

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...

View solution in original post

5 REPLIES 5
SanfordWhiteman
Level 10 - Community Moderator

Re: Is it possible to map two different tokens?

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...

JohnnyVillarini
Level 2

Re: Is it possible to map two different tokens?

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
Level 10 - Community Moderator

Re: Is it possible to map two different tokens?

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!

JohnnyVillarini
Level 2

Re: Is it possible to map two different tokens?

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 &lt; and &gt; I thought it would take it away but it hasn't. Do you know if &lt; and &gt need to be added elsewhere?

 

JohnnyVillarini_0-1620310775436.png

 

Update: I just had to take out &lt; and &gt lol. Thanks again! I will definitely be using this for future customization

 

 

SanfordWhiteman
Level 10 - Community Moderator

Re: Is it possible to map two different tokens?


Update: I just had to take out &lt; and &gt lol. Thanks again! I will definitely be using this for future customization

Yep, that's what I was gonna suggest. 🙂