Nested Tokens

Nested Tokens

I'm wondering if there's a capability of nesting tokens within other tokens.  For example, if I want to send an alert with a lead's phone number, and if that field happens to be blank, use their email address as the default.

{{lead.Phone Number:default={{lead.Email Address}}}}

Depending on the data set, this could have great application on landing pages, as well.  I thought we were really on to something, but I received token errors when trying to incorporate this idea.
14 Comments
Anonymous
Not applicable
If this feature isn't yet available, it should be!
Anonymous
Not applicable
Ya, this would be really helpful.

Depending on your CRM, a work-around would simply be a calculated field that pulls both of these values;

If(phone = "" THEN email ELSE phone) or something like that. then mapping that field over to Marketo and simply tokening that new calculated field. Of course thats kind of a pain to setup, and very messy... but at least it would work for the time?
Anonymous
Not applicable
I was just told today that you can't put a token inside another token. BUT this was specifically when trying to include the membersip link & ID tokens into a Save the Date using the calendar token.

Not sure if this is because once you open the calendar file you are no longer connected to Marketo so it can't recall the other info? So MAYBE this is a possiblity but the blanket answer I got was "You can't put a token inside of a token"

Not sure this is helpful but at least another data point 🙂  
Kenny_Elkington
Marketo Employee
Hey Jace,

For emails, you can create functionality like this via an email scripting token, just by saying if phone is empty, use email.  You can read more about this here: http://developers.marketo.com/documentation/email-scripting/
Anonymous
Not applicable
Thanks Kenny!

That's helpful for this case.  Looks like I'll have to brush up on my scripting skills.  

From what I gather then, there's really no way to utilize this feature on landing pages since the token is in email scripting.  Is that accurate?

Thanks again for the insight.
Kenny_Elkington
Marketo Employee
I suppose you could set something up with some custom JS.  If you passed the tokens into a JSON object, you could display them conditionally.  Something like this:

var contactInfo = {"phone":"{{lead.Phone Number}}","email":"{{lead.Email}}"};

You could then say if phone is not empty, display phone, else display email.
Anonymous
Not applicable

This would be really helpful in the email unsubscribe link, too, as we have multiple groups for which we would want to surface different Communication Preference and unsubscribe pages. We're aware there are ways to work around it for the system unsubscribe token, but nested tokens would be a really useful feature in this use case.

Anonymous
Not applicable

We do something similar to this in our Landing Pages. Obviously not possible in emails. Some of the requests in this thread can be achieved using Email Script tokens. Unfortunately there are some technical issues around using script tokens and link tracking, so it is not always a fit.

We refer to this much wanted feature request as tokception. If it was available it would dramatically improve productivity. We rely heavily on snippets to create versatile emails. This is one of the areas where we trip up. The content is already tokenised. It would be great if we could refer to other tokens for links in our Rich Text tokens, or personalise preheader text that is injected via tokens.

SydneyMulligan
Level 10 - Champion Alumni

This would be really helpful for those of us who heavily rely on program level tokens. It's very frustrating to me that if I have a rich text token that contains my email body text, I can't use any tokens inside of that (such as for a webinar registration page, or a lead's first name)

Anonymous
Not applicable

If you don't mind putting your email copy into velocity you can always use an Email Script Token that pulls in lead tokens, or even custom tokens.