I was wondering which activity I should use to set a variable to different values depending on what string is contained in another variable. For example, this is what I want to do:
Variable1 = String
If Variable1 contains “Do This” set Variable2 to “Type 1”
If Variable1 contains “Do That” set Variable2 to “Type 2”
If Variable1 contains “Blah Blah” set Variable2 to “Type 3”
I am trying to use the Pick activity and pick branches to assign the variables, but I am not sure what to use in the Trigger area or if this is even the best way to do what I need.
Hi @KarthikByggari, that is something I should probably look into as it would be easier in the long term, but I did find that the Is Match activity seems to work for checking if the variable contains a certain string.
Sounds like you might use a Switch activity. Then, use inline If statements. You can also skip the Switch and just place it in an Assign activity: Assign: variable2 = If(variable1.Contains("Do This"), "Type 1", If(variable1.Contains("Do That"), "Type 2", If(variable1.Contains("Blah Blah"), "Type 3", Nothing ) ) )
And, you can use Is True or Is False activities, found in the Workflow Manager package, to create a Boolean, if you want. However, it requires an additional variable.