Nintex Workflow – Switch Action
Since the release of Nintex Workflow (build 11000), we have been given new actions that really make life a lot easier in many ways. Being a developer, whenever a new action appears that mimics some type of code, my interest is peaked. The one that has really got me excited is the Switch action. Not only will this action make my life easier in designing workflows, it’s going to make it faster to design them, they will look much more logical, and in the future it is going to be a hell of a lot easier to maintain. So to try it out, I created 2 workflows. One using the standard Set a Condition action :
The other workflow is using the Switch action to see the difference :
Each workflow looks at a field in my list called Day which is a “number” field. It checks if that field is equal to 1, or it is equal to 2 or it is equal to 3. I want to perform some business logic, specific to the value of that field. In my example, I’m strictly logging some information to the Workflow history. Both workflows ran successfully, but as you can see from the screenshots above, the Switch workflow is much easier on the eyes and easier to understand. The best part is, when you look at the graphical view of the workflow, you can really see the difference in the ability to understand the flow of that particular instance of the workflow. Original Workflow Graphical View :
Configuration of the Switch action is really quite simple. You select the workflow variable that you want to compare the value of. You then click on the “Add switch value” link, to add as many switch conditions as you want. If you want to handle every other value, make sure the check the “Include an ‘other’ value branch”.
I’m looking forward to making new workflows using this great action and even updating existing workflows. Hopefully, minimizing their size and complexity. Below are the links to the 2 workflows that I discussed above :