I am having same challenge.
In the Marketo Flow Action logic the Attribute LOV only displays Lead attributes ( lead fields).
If you create a program token you will not find in the Lead attribute list.
Program Tokens are only available in Digital Assets (EMail or LP) for now.
oh so you want a new line in a field.
Do a quick search. there are some threads on this. It is not easy.
I've been searching and reading for months for a solution to this. If you have any links to info, please share.
Thanks!
I've got a method that works. It's delicate and it's probably best if I walk you through it remotely. DM me if you want.
Example audit trail field:
Finally revealed here: http://blog.teknkl.com/dark-mkto-alleys-line-break-token/
Sanford Whiteman, your solution works great when the values need to be stored like this in a history field. The issue arises when we use that history field as a token in an email. For example, here's the value in the lead record:
2017-07-24 13:48:10: Visited 5 or more web pages in 1 day
2017-07-24 12:14:09: Filled Out Contact Us Form as Potential Customer (Overseas Adventure Travel): Contact Us 2.0 (USA) on www.avanade.com/en-us/contact
But when we use {{lead.Interesting Moment History}} in an email alert, it appears as follows (with no line breaks):
Any ideas on how to have this render properly in an email?
${display.br($lead.InterestingMomentHistory)}
in a Velocity token.
Different output contexts, different line break sequences....
That doesn't seem to work. Here's the exact velocity token - called {{my.IM History}} that I'm using:
${display.br(${lead.avanadeInterestingMomentHistory})}
For your reference, the history field is built as follows:
{{lead.Last Interesting Moment Date}}: {{lead.Last Interesting Moment Desc}}{{my.line-break}}{{lead.Avanade Interesting Moment History}}
where "my.line-break" is using the approach you describe in this post.
What kind of "doesn't work" -- what's the output HTML?
$display.br() is a built-in method to replace true newlines with HTML <br />, so it's perfect for this. (We could write the replacement in VTL but shouldn't need to.)
Here's the token:
Here's how the token is used in the email alert:
And here's how it renders in an email (instead of pulling the history value from the lead record, it's including the actual script):
The field is checked off in the tree on the right-hand-side of Script Editor?
It was when I initially created it (since I checked it; and dragged the field into onto the canvas) - but after checking now, it was not checked. So repeated the process again (confirmed it's now checked, even after saving, closing and re-editing the script). Here's the result:
Do you think I need to use two line-break tokens in the history field, instead of one?
Here's the value as it appears in the database:
Nah, only need one. br() changes every single linebreak. What about if you manually hit enter in the field and add another line? That'll help us narrow down.
Nope, same result as above. Here's the new value in the DB:
2017-07-24 12:58:39: Promoted to MQL after attending an Avanade Event: 2017-06-14 NA USA EV-ML Retail Executive Summit-ERP TracyA
2017-07-24 12:48:44: Attended an Avanade Event: 2017-06-14 NA USA EV-ML Retail Executive Summit-ERP TracyA
2017-07-24 12:43:47: Registered for an Avanade Event: 2017-06-14 NA USA EV-ML Retail Executive Summit-ERP TracyA
Dan, I can't repro this.
Here's text field with newlines:
The Velocity token to change the true newlines to <BR>s:
And the output:
I even tried another technique that you authored here: http://blog.teknkl.com/newlines-to-brs-in-velocity/
And still no luck. I also tried using a bare-bones HTML email. This is driving me crazy.
So bizarre! What would Velocity be doing here if not altering the output... and not throwing an error?
It's as if your fields don't contain \n.
Can you try another replacement, as a sanity check?
${lead.Lead_Notes.replaceAll(".","<BR>")}
Now we're getting somewhere. Here's the email - where everything has been replaced with <BR> - the gray area is me highlighting them with my mouse:
And here's the code to prove it:
But I have no periods "." in that field. What was replaced with all of those <br>'s? Or did this replace every character (including the 2 line breaks) with a <br>? There are are 17 characters (include the breaks), and 17 <br>s here.
The dot is regular expression syntax for "any character," so the idea was to see what you saw.
Now try this:
${lead.Lead_Notes.replaceAll("\r","<BR>")}