AnsweredAssumed Answered

MathTool to Get Random Number

Question asked by Liz Davalos on Jan 18, 2018
Latest reply on Jan 18, 2018 by Sanford Whiteman

I'm trying to create a velocity script that outputs different text randomly (for testing copy in snippets) so my intention is to randomly generate a number and if it is even then output one line versus the other. If I can get it working then I'd add more content with different tracking so I know which one is generating response.

 

I cobbled together this script that isn't working and I'm not sure why?

#set ($random = $math.getRandom())
#if($random / 2 == 0) 
#set ( "The Most Loads<br />The Best Rates")
#else 
#set ( "637,000 Loads<br />Posted Daily")
#end

Outcomes