One of the problems with workflows is that,while you can group conditions with an OR in Advanced Find, you do not have the same ability within workflows.
Here are the advanced find grouping buttons.
Here is the workflow box for a ‘Check Condition’ step.
We can list multiple conditions but these are automatically grouped with an ‘AND’ clause i.e. all must be fulfilled.
This issue has come up in the forums in the past and, usually I recommend the creation of two workflows: one for each condition. While this approximates an ‘OR’ it is a lot of work.
The problem with this solution is we now have two workflows to maintain which means more overhead.
De Morgan’s Law tells us that ‘A OR B’ is logically equivalent to NOT (NOT A AND NOT B). So how does this help us?
Well, to deal with the first ‘NOT’ we use the ‘Default Action’, which gives us an ‘Otherwise’ to our ‘If-Then’
Therefore, if we say ‘if (NOT A AND NOT B) then do nothing otherwise do x’ we have a winner.
So, in practice, let us say we want the workflow to trigger if either of one of two tickboxes are ticked. For an advanced find it is east to find records where Tickbox A or Tickbox B has been ticked.
For our workflow it is going to read thus:
If we trigger this off of the two fields changing, if neither of the fields are ticked, nothing happens but if either or both are ticked our action happens, which is what we want.
If you have a more complex problem, this is how to approach it.
First of all we have De Morgan’s Law: A OR B = NOT (NOT A AND NOT B)
Let us define our logical tests:
A: Tickbox A = Yes B: Tickbox B = Yes
NOT A: Tickbox A = No NOT B: Tickbox B = No
So Tickbox A = Yes OR Tickbox B = Yes is equivalent to NOT (Tickbox A = No AND Tickbox B = No) and this is expressed as we saw above using an if-then-otherwise step.
Using this technique, while a little harder to read (although the comment line can help) we maintain just one workflow, saving on future administration. The technique is also applicable to any condition which there is a straightforward ‘opposite’ version of and can be extended to multiple attributes, not just two, without having to resort to creating multiple, mostly identical workflows.
Other Microsoft Sites
I'm a Customer
I'm a Partner
Follow Microsoft Dynamics