SOLVED

Re: Remove Space in Token Default Value

Go to solution
Anonymous
Not applicable

Re: Remove Space in Token Default Value

Here is a possible solution - the value of your token when you have a sponsor would be ", and a special thank you to our sponsor [sponsor name]."  And the default value for your token would be "."  Place your token immediately after the word "week" with no following comma or space.
Anonymous
Not applicable

Re: Remove Space in Token Default Value

This thread is helpful! I was having the same space issue as Andrea is having above. Guess I will just remove the comma.

James_Glavin
Level 5

Re: Remove Space in Token Default Value

I'll add my thoughts to this thread, even thought it's a bit of an old one; I was scratching my head about the space plus comma issue too.

I considered this solution:

Hello {{lead.First Name:default=!}}

which results in 'Hello !' if you don't have a first name for a lead. It's not technically correct punctuation, but I preferred how it looked to just 'Hello' on it's own with no punctuation at all.

But in the end I went for: 

Hello {{lead.First Name:default=there}},

So you either get

Hello James,

or

Hello there,
 
Anonymous
Not applicable

Re: Remove Space in Token Default Value

This works for me:

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

#if ($firstName == "")

  #set($temp1 = "Hello,")

#elseif ($firstName.contains(" "))

  #set($temp1 = "Hello,")

#elseif ($firstName.length() == 1)

  #set($temp1 = "Hello,")

#else

  #set($temp1 = "Hello " + $firstName + ",")

#end

${temp1}