Complex tokens/personalized data | Community
Skip to main content
Jennifer_Bisho1
Level 4
November 30, 2018
Question

Complex tokens/personalized data

  • November 30, 2018
  • 3 replies
  • 7403 views

We are looking into sending an email out that has complex data fields that need to populate within the body as tokens (or however else this would be possible).  Please see the attached sample database as an example.  Basically, some fields will have multiple values that we want to display as a list.  Does anyone know how we could make this work?  Our outside agency has said that they can create Marketo custom objects to do this, but I was wondering if there is an easier way.  Thanks!

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

3 replies

Josh_Hill13
Level 10
November 30, 2018

Velocity Scripting. See developers.marketo.com and some other threads here.

SanfordWhiteman
Level 10
November 30, 2018

You definitely don't need a Custom Object.

As Josh says, Velocity could easily parse and slice-and-dice this data. Just write it as a JSON string (spreadsheet rows = array of objects) to a Textarea field on the lead.  Then a Velocity ("Email Script") {{my.token}} can sort, pluck, output, etc. from this lightweight data source.

On the other hand, you haven't given an example of how the list needs to be formatted for output. If you just want to dump the whole thing (no filtering or other formatting) you could just store it as preformatted HTML in the Textarea.

Jennifer_Bisho1
Level 4
December 3, 2018

Hey Sanford - good to know.  Unfortunately, I have zero knowledge of Velocity/JSON.  Is that difficult to learn?

I'm thinking that we'd want the enduser and service amount columns to be next to each other in a table within the email body, and have them display like it looks in the spreadsheet (on separate lines).

SanfordWhiteman
Level 10
December 3, 2018

I have zero knowledge of Velocity/JSON. Is that difficult to learn?

Achieving actual mastery of Velocity is very difficult. A familiarity with some basic functions isn't that hard if you have a good teacher , but parts of this effort are on the hard side (converting a JSON string field to a living Velocity object only a takes a few lines of code, but those lines are not at all well-known).

But let's get back to my other question. In this particular case, it doesn't sound like you need to filter, remap, sort, or otherwise change the original data, that is, it doesn't have to be a living data source. Why not have it be stored in a Textarea as an HTML <table>, already laid out?

Jennifer_Bisho1
Level 4
December 3, 2018

Also...can someone dumb down how to explain custom objects to me?  lol.  I know I'll need to be working with these early next year since we are connecting Salesforce, but I've never used them before.