Velocity concatenate not working with comma? | Community
Skip to main content
February 24, 2017
Solved

Velocity concatenate not working with comma?

  • February 24, 2017
  • 1 reply
  • 1773 views

Hello Marketo users,

I am trying out my second velocity script. Somehow commas are breaking the script. $greetll is not printing correctly in the email, and the part is breaking is ${greeting}, what I see from the else part is ", we love local". Can you someone help? thanks!

#set ($fname = ${lead.FirstName})

#if($fname.equals("Unknown")||$fname.contains("?"))

It's true, we love local

#else

#set($greeting = $display.capitalize($fname))

#set($comma = ",")

#set($lovelocal = " we love local")

#set($greetll = "${greeting}$comma$lovelocal")

$greetll

#end

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

Looks like you didn't check for empty.

#if($fname.equals("Unknown") || $fname.contains("?") || $fname.isEmpty())

1 reply

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
February 24, 2017

Looks like you didn't check for empty.

#if($fname.equals("Unknown") || $fname.contains("?") || $fname.isEmpty())