Using a workflow switch with checkboxes

jcwarren
Kilo Guru

We have a requirement to route catalog tasks based on checkboxes options selected on a catalog form. 

I've added a Switch activity which picked up the checkbox variables as expected. However, the routing stops at the switch. I've tried various values in the Conditions section, i.e., activity.result == 'variable_options'. The switch does not seem to be interpreting when the checkbox value is True.

Is there a way to configure the switch conditions to recognize a True value of a checkbox so that the routing continues?

 

Any assistance would be greatly appreciated.

1 ACCEPTED SOLUTION

jcwarren
Kilo Guru

Thanks, Brad. We'd tried the solution you proposed prior to submitting a request for assistance (it didn't work).

We went with a Branch activity connected to a respective number of If statements. Works as expected.

Thanks again.

View solution in original post

2 REPLIES 2

Brad Bowman
Kilo Patron
Kilo Patron

This is not a great / recommended / best use of the Switch activity, but it will work if your affirmative condition is

activity.result=='true';

Depending on the design of the workflow, you don't need an alternate condition - it can just hang out at each activity that isn't true, until the workflow finishes, or add another condition to route the unchecked cases elsewhere.

 

You could instead have If activities that return Yes if the box is checked, or even one Run Script Activity that sets the result based on each checkbox, then you would add one condition for each result.

jcwarren
Kilo Guru

Thanks, Brad. We'd tried the solution you proposed prior to submitting a request for assistance (it didn't work).

We went with a Branch activity connected to a respective number of If statements. Works as expected.

Thanks again.