Skip to main content
Chelsey_Davis
Level 3
July 12, 2017
Question

Token in a Token?

  • July 12, 2017
  • 2 replies
  • 5293 views

Is there a way to insert a token within a token? Here's my situation:

My company uses the "call webhook" option in the flow to push out newsfeed and push messages to an app. The tokens in each campaign house the specific messaging needed for each campaign. For example, webhook 'MyHome Push and 2 Newsfeed' will push out messaging that's listed within the tokens below to the app.

Tokens:

{{my.myhomepush}}

{{my.myhomenewsfeed1}}

{{my.myhomenewsfeed2}}

If we want to pull in specific user information (let's just say {{lead.first name}} for now), can we edit {{my.myhomenewsfeed1}} to say something like "congrats, {{lead.firstname}}. You've completed such and such task..."

If not, does anyone have any ideas on how to pull in specific lead information using the webhook method listed above?

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

2 replies

Devraj_Grewal
Level 10
July 12, 2017

Chelsey,

Unfortunately, nesting tokens within tokens is not possible: https://nation.marketo.com/message/121397#comment-121397

But you can vote for the idea here: Nested Tokens

SanfordWhiteman
Level 10
July 13, 2017

Since you're passing to a webhook already, why not have an intermediate webhook assemble the payload from multiple tokens (combining my. and lead.tokens as in your example)? FlowBoost can do this easily.

Also, note that in emails, you can combine Velocity my.tokens and lead.tokens. This capability is frequently overlooked: one my.token can contain a template, like

#define( $mygreeting )

Hello ${lead.FirstName}

#end

then in that or another Velo token you can output

${mygreeting}

And for webpages, you can have a Text {{my.token}} that contains a JS template, like so:

then include both tokens in the page:

var FirstName = '{{lead.FirstName}}',

      mygreeting = `{{my.greeting}}`;

What you can't technically do, though, is easily define a Text {{my.token}} as containing a {{lead.token}}. But almost everything you want can be done in code.

Chelsey_Davis
Level 3
July 19, 2017

Thanks, Sanford.

I'll have to test this out to see how I can make it work!