Using a switch statement to evaluate multiple true/false variables

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2018 12:30 PM
I have a form that has 5 checkbox variables and a requester can select all 5 checkboxes.
Is there a way to build a switch activity to evaluate these checkboxes instead of creating 5 if statements? Trying to simply this workflow as much as possible.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2018 12:45 PM
Switch activities expect 1 result and in your case you can have multiple since these are checkboxes that can be checked independently. You can certainly script this with a single run script that evaluates the checkbox and creates a task but you lose the visual view of it. If you need to wait for all the tasks to complete prior to a subsequent activity that is more difficult scripting the tasks as well.
Unfortunately your nested Ifs is really the easiest way to accomplish what you are after via workflow.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2018 12:48 PM
Check out this article:
Workflows - Playing With the If Activity
This is an example of how to use an If statement to evaluate the input and allow for multiple outputs activities.
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2018 12:58 PM
Nice find. This should work for the OP use case.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2022 09:41 AM
Hello @Community Alums
Is there any chance you could provide an updated link?