Complex tokens/personalized data

Jennifer_Bisho1
Level 4

Complex tokens/personalized data

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!

7 REPLIES 7
Josh_Hill13
Level 10 - Champion Alumni

Re: Complex tokens/personalized data

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

SanfordWhiteman
Level 10 - Community Moderator

Re: Complex tokens/personalized data

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

Re: Complex tokens/personalized data

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

Re: Complex tokens/personalized data

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

Re: Complex tokens/personalized data

JavaScript is something out of my realm of knowledge   I'm asking about this because the agency that we outsource to is working on this email, and they are asking to be granted admin rights to create custom objects for this.

No, it will not be living data.  It will be pulling in text from an uploaded list that has those columns.  The problem is that I don't want to go creating a bunch of new fields to pull in all of that info.  To my knowledge, there's no way to pull in text with line breaks into an area.  Formatting is our major issue when it comes to this email.  Also, some contacts may have 3 end users and others may have 10, so they all will not have the same amount of lines of text that needs to pull in (for enduser and service amount).

SanfordWhiteman
Level 10 - Community Moderator

Re: Complex tokens/personalized data

I'm asking about this because the agency that we outsource to is working on this email, and they are asking to be granted admin rights to create custom objects for this.

Certainly not necessary to have COs.

JavaScript is something out of my realm of knowledge

(Not sure what you mean about JS, that language isn't as easy as people act like it is either! But Velocity is very different, with its own quirks and powers.)

To my knowledge, there's no way to pull in text with line breaks into an area.

None of this matters when you use a Textarea field.  A block of HTML with <table>s and <td>s and <br>s and text will print as-is.

Jennifer_Bisho1
Level 4

Re: Complex tokens/personalized data

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.