Nintex Workflow – All must agree on a specific outcome
When using the Assign a Flexi Task action, one of the “behavior” options is “All must agree on a specific outcome”.
A good scenario here, is if you have a Project Proposal, and everyone who is assigned the task must approve the proposal. If someone doesn’t, the it’s a no-go.
In the above example, I only have 2 possible responses (Approve and Reject).
The thing to note, is that if an approver selects “Reject”, the workflow will not go down the Reject path. Instead, it will go down a path called “Other”. This is a hidden branch, but in order for your workflow work correctly, you should make it visible.
To do this, in the configuration of the Assign a Flexi Task action, scroll down to the bottom, expand the “Advanced options” section, and check the box to show the “Other” branch.
The issue is, that when someone does not pick the specific outcome, there really no easy way to figure out what outcome was selected and by whom. I’ve found one way of doing it. As I’ve said in the past, this is by no means the only way to get this information. It’s just the way I found was easiest for me.
Getting the latest outcome from the Approver Comments
When you have an Insert Reference button in one of the Nintex Workflow actions, you’ll see that one of the properties you can get from that Insert Reference popup window is called the “Approver Comments”. This is the latest approver comments for a task created in that instance of the workflow.
These comments start of with the user who created them, followed by the outcome selected by that user in round brackets.
To extract the outcome selected, I found the following Regular Expression gave me what I needed:
What this is the following:
(?<=\)) – this is a Positive Lookbehind. It will match an open round bracket but not include it in the results.
.* – matches all characters
(?=\)) – this is a Positive Lookahead. It will match a closed round bracket but not include it in the results.
This Regular Expression will find me the text that is surrounded by open and closed brackets.
Once the Regular Expression action has run, you can use a Collection Operaiton action to perform a get. The first entry in the collection is what we are after, and store the result in a Text variable. We now have out selected outcome.
Who selected that outcome?
Now that we have the outcome selected by our non-conformist , we need to find who this person is. This comes in handy if you want to build in logic into your workflow to notify someone that the task was not approved, or you want to send that user a different task.
In this case, we can use similar logic (Regular Expression -> Collection Operation).
This time, the Regular Expression is :
Now that I have this information, for my own testing, I use a Log in the History List action to log the Approver and the Outcome they selected.
You can see that I logged the information I was hoping for. If you need to, you could run other Regular Expressions on the Approver Comments to retrieve other information (eg. Date/Time it happened and the comment itself).