Power Automate trigger condition based on SP multiple choice field value

“I have a SharePoint multiple choice field: Red, Green, Blue, and I want the Power Automate flow to trigger if Red is one of those choices.”


When you work with SharePoint columns, you can easily create a trigger condition with the ‘Filter array’ action. If it’s a simple column, e.g. single line of text, you can take the column as it is. For the more complex columns, e.g. people picker or choice, you select the specific property you want to use. It can be for example the ‘Column Value’ or ‘User Email’ from the available dynamic content. But once you enable multiple selection in those columns, the ‘Filter array’ trick won’t work.

If you try that it’ll add ‘Apply to each’ around the ‘Filter array’ and create a condition referencing the ‘Apply to each’. That’s not a trigger condition you can use. Trigger condition can use only output from the trigger, it can’t reference any action.

Get the list of values from trigger

Since it should be a trigger condition, the only way to build it is using expressions. As you can’t use any action, everything must be processed in a single step. It’s a similar situation to exporting multiple choice column values to .csv or HTML table, you’ll need the xpath(…) expression. I recommend you to check that article for better understanding of how the expression is created.

xpath(xml(json(concat('{"body":{"value":', triggerOutputs()?['body/Choice'] , '}}'))), '/body/value/Value/text()')

Note: the Choice part in …?[‘body/Choice‘] is the internal name of your multiple choice column.

The expression will extract only the selected values into an array without the additional information.

Build the trigger condition

Now, when you know how to get the values, you can use this knowledge to build the trigger condition. Going back to the ‘Filter array’ action, this expression is what you want to use on the left side. Since the result will be an array, use the ‘contains’ operator to check if the array contains a specific value. In the example below it’ll look for the value Red. Define the condition and switch to advanced mode.

The output will be the trigger condition…

@contains(xpath(xml(json(concat('{"body":{"value":', triggerOutputs()?['body/Choice'], '}}'))), '/body/value/Value/text()'), 'Red')

…which you can just copy/paste as a Trigger Condition to the trigger settings.

Such flow will trigger only if the multiple choice column ‘Choice’ contains value ‘Red’.

Summary

If your Power Automate flow should trigger only when users select a specific choice in a multiple choice field, you’ll need to dive into expressions. Since it’s a trigger condition, you can access only data from the trigger, and if the data is complex, so will be also the expression.

The solution above described multiple choice column, but the same approach can be used also for multiple people picker column. Extract all the relevant values in a single, yet complex expression, and check if it contains the required value. The flow won’t start unless it’s there.


Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

Add a Comment

Your email address will not be published. Required fields are marked *