Power Automate and SharePoint already had an action to start a flow when an item/file was created or modified. But not yet an action for when an item is modified only.
With this new “When an item or file is modified trigger” action, we can trigger a flow when for example a status column has been modified.
A status column could have following values:
- Not started yet
- In progress
Let’s imagine that you want to start a flow when the status has been changed. But you only want to start the flow when the status was changed to “Completed”. When the status changes to other values, you don’t want to start the flow.
To do this, we can go into the settings of the trigger:
At the bottom, you will see the trigger conditions.
A common mistake after adding a new trigger condition, is forgetting to click “Done”. If you don’t click on “Done”, your trigger won’t be saved, even not if you save the whole flow.
Let’s dive into the trigger conditions now. How can we compose these trigger conditions?
We only want to start the flow if the “Status” column is equal to “Not started yet”.
Our trigger condition will be as follows:
@equals(triggerBody()?['Status'],'Not started yet')
This is a trigger condition to check the value of a single line of text field.
The column name between the quotes and the square brackets is the internal column name, not the one you see in the list. If you have a space in your column name, it will be something like Status%20Approval.
If you want a trigger condition for a yes/no column it will be like this:
We can also combine multiple conditions:
Do you want to check if a column is empty? Use:
Do you want to check if a column is not empty? Use:
As you can see, you can use single functions or combine multiple to set a condition on running your flow in Power Automate.
Always check your condition because you can quickly make a syntax mistake. Don’t forget to click the “Done” button after you filled the filter condition. Otherwise your filter condition will not be saved, even not if you save the flow.