AnsweredAssumed Answered

Can you script a table inside of a custom token?

Question asked by Alex Bridges on Sep 12, 2018
Latest reply on Oct 2, 2018 by Sanford Whiteman

This thread started as a result of the outcome from this previous thread: How to get a token script to display information from Opportunity Object?

 

I am creating a template that includes several tables, which has tokens from the lead object, and needs tokens from the opportunity object. The number of tokens required exceeds 40 tokens - the limit in a given email.

My first workaround was to use formula fields, but discovered I can't use custom tokens created from the opportunity object in formula fields.

 

My next thought was to create a custom token with the content of the formula field - script a table and put all the needed fields within it. How would I go about having a velocity-scripted token recognize HTML, though? In our example case, let's say I want my one custom token to have the code for one table. The table has 10 rows and 4 columns. Half of my field values would be based on the lead object, while the other half are based on the opportunity object. How would I script to include the table with 20 tokens?

 

Thanks!

Outcomes