“When an item or file is modified” trigger conditions

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
  • Completed

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:

Where to find the trigger condition settings in a trigger action

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.

Trigger conditions in the settings of a Power Automate trigger

Let’s dive into the trigger conditions now. How can we compose these trigger conditions?

Input field for a trigger condition

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:

@equals(triggerBody()?['RunApproval'],true)

We can also combine multiple conditions:

@or(@equals(triggerBody()?['Code'],1),@equals(triggerBody()?['Status'],'Completed'))

Do you want to check if a column is empty? Use:

@empty(triggerBody()?['Column_Name'])

Do you want to check if a column is not empty? Use:

@not(empty(triggerBody()?['Column_Name']))

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.

Leave a Reply

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