SOLVED

Velocity concatenate not working with comma?

Go to solution
Highlighted
Anonymous
Not applicable

Velocity concatenate not working with comma?

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

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Level 10 - Community Moderator

Re: Velocity concatenate not working with comma?

Looks like you didn't check for empty.

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

View solution in original post

1 REPLY 1
Highlighted
Level 10 - Community Moderator

Re: Velocity concatenate not working with comma?

Looks like you didn't check for empty.

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

View solution in original post