Re: Escaping quotes in velocity token

Jay00031987
Level 4

Escaping quotes in velocity token

 

 

'Let''s have fun with "quotes"',
  "Let's have fun with ""quotes"""

 

 

Below error is throwing while evaluating the above strings with double quotes for a custom object CO field itemDetails1

 

Cannot get email content- <div>An error occurred when procesing the email Body! </div> <p>Lexical error: org.apache.velocity.runtime.parser.TokenMgrError: Lexical error at line 1, column 7. Encountered: "\u00e0" (224), after : "" near</p> <div><pre > #set( $jsonDetails1 = '#set( $jsonDetails1 = ' + $CO_c[&quot;itemDetails1&quot;] + ' )' )</pre><pre > #evaluate( $jsonDetails1 )</pre><pre class="x-form-item-label"> #end</pre><pre > #if( !$CO_c[&quot;itemDetails2&quot;].isEmpty() )</pre><pre > #set( $jsonDetails2 = '#set( $jsonDetails2 = ' + $CO_c[&quot;triggerDetails2&quot;] + ' )' )</pre></div>

 

is there a workaround in Marketo to evaluate the double quotes?

 

Jay
1 REPLY 1
SanfordWhiteman
Level 10 - Community Moderator

Re: Escaping quotes in velocity token

Please provide the full contents of the Textarea field.

Note you need to escape reserved characters using \u0000 format, not shortcuts like \".