SOLVED

Re: Velocity Email Script - Greater Than or Less Than Operators

Go to solution
Anonymous
Not applicable

Velocity Email Script - Greater Than or Less Than Operators

I want to serve content based on whether or not the Score field is greater than an certain number.  I've been able to do equals, doesn't equals, and contains, but cannot figure out greater than (or less than)

This is what I thought should work but hasn't:

#set ($ScoreCount = ${lead.scoreCount})

#if($ScoreCount > 10)

Content A

#else

Content B

#end

Any thoughts on if this is possible?

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Velocity Email Script - Greater Than or Less Than Operators

What you have is fine if the variable is really an Integer. I suspect it's coming in as a String, so convert it:

#set($ScoreCount = $convert.toNumber($lead.scoreCount) )

#if($ScoreCount > 10)

Content A

#else

Content B

#end

View solution in original post

2 REPLIES 2
SanfordWhiteman
Level 10 - Community Moderator

Re: Velocity Email Script - Greater Than or Less Than Operators

What you have is fine if the variable is really an Integer. I suspect it's coming in as a String, so convert it:

#set($ScoreCount = $convert.toNumber($lead.scoreCount) )

#if($ScoreCount > 10)

Content A

#else

Content B

#end

Anonymous
Not applicable

Re: Velocity Email Script - Greater Than or Less Than Operators

that worked perfectly! You're the best!