AnsweredAssumed Answered

email script - if field(s) contains a & b, write x

Question asked by Charles Sanderson on Mar 19, 2019
Latest reply on Mar 19, 2019 by Sanford Whiteman

I was hoping to solve this problem with segmentation... but realized that I can't, if the user makes multiple choices. But I'm not finding Velocity syntax for what seems like it should be a simple thing:

 

If person's field contains "a" do "x" ... and a multiple, if contains "a" and "b" . I

 

This is based off a form with multiple choice checkboxes. That populates a string field with something like "000012; 000015" - if they've checked those two options.

 

I know ==, I've found ".contains" but I can't seem to figure out "!does NOT contain"

 

EDIT: I tried this - which didn't work at all, but probably gives a clear picture of what I'm trying to do:

 

#if ( index($lead.resourceChoice1, '0001' ) == 1) && ( index($lead.resourceChoice1, '0002' ) == -1)  
#set($assettype = "Chose 1, but not 2 - content")
#elseif ( index($lead.resourceChoice1, '0001' ) == -1) && ( index($lead.resourceChoice1, '0002' ) == 1)  
#set($assettype = "Chose 2, but not 1 - content")
#elseif ( index($lead.resourceChoice1, '0001' ) == 1) && ( index($lead.resourceChoice1, '0002' ) == 1)  
#set($assettype = "Chose 1 & 2 - content")
#elseif ( index($lead.resourceChoice1, '0001' ) == -1) && ( index($lead.resourceChoice1, '0002' ) == -1)  
#set($assettype = "Chose None - content")
#else
#set($assettype = "default content")
#end
##print it out
${assettype} 

Outcomes