JP.jpg

Hi.

Welcome to SharePoint Simply. I am a non-technical SharePoint person just like you. Follow along while I learn things and help you do them.

Microsoft Flow: How to create conditions that check multiple values

UPDATE February 2019: Flow has been updated to allow multiple “AND/OR” conditions in a single step in the default condition interface. This “advanced mode” post is now essentially moot. You can create new rows for adding conditions or you can add new groups to go between “and” and “or” conditions.

Updates to the condition action user interface

Updates to the condition action user interface

Time to do this: 2 minutes

If you use Microsoft Flow at all, you’ll inevitably come across a situation where you want your condition to check a bunch of things. For example, let’s say you have a SharePoint list with some custom columns like “Status” and “Request Type.” You might want…

  • To take some sort of action when the Status is “Pending” (or whatever) and the Request Type is “Urgent” (or whatever)

  • To take some sort of action when the Status is “X” (or whatever) OR the Request Type is “Y” (or whatever)

This can be done relatively easily if you 1) know the Flow syntax or 2) are decent at following instructions. (screen shots at the bottom if you need them)

  1. Go into your condition and make sure it’s in “basic mode”

  2. Choose your dynamic value

  3. Choose your comparison option (or whatever those would be called)

  4. Enter your value in the far right box

  5. Click “Edit in advanced mode”

Condition shown in basic mode with link to “Edit in advanced mode.”

Condition shown in basic mode with link to “Edit in advanced mode.”

You’ll end up with something like this: @equals(triggerBody()?['ColumnName'], 'ColumnValue'). You can do this for multiple conditions and then COMBINE THEM WITH SYNTAX MAGIC. This is how it should end up looking…

Multiple “and” conditions

@and(equals(triggerBody()?['ColumnName'], 'ColumnValue'),equals(triggerBody()?['ColumnName']))

If you notice, you’re adding a few small things here. You’re adding the “and” right after the opening @ and you’re separating that from the “equals” part with an opening parenthesis. Then to combine another condition, you use a comma, and “equals,” this time without the leading @. Make sure you close everything up with your double parentheses.

Multiple “or” conditions

@or(equals(triggerBody()?['ColumnName'], 'ColumnValue'),equals(triggerBody()?['ColumnName']))

Surprise. It’s the same - minus the word at the very beginning.

Side Notes

You obviously don’t have to use “equals” on everything. This will still work if you’re conditions are looking for values using “less than”, “contains,” etc.

Once you combine conditions in “advanced mode” you can’t switch back to basic mode or Flow will bark at you and say something like: “Condition is too complex or invalid. Unable to switch to basic mode.”

SharePoint: Quick Edit option not available on list

Microsoft Flow: Make a condition to check for empty fields or null values