top of page
Writer's pictureKyle Anderson

Exploring Flow Trigger Filters

Updated: Jul 30, 2020

As a developer and maker of flows in Power Automate, how many times have you seen or used a variation of this?

Trigger and Logic Statement

It seems like an innocent enough approach to take; we wait for the flow to trigger, and then check the appropriate column/s for the value/s we want. The issue is that there is a monthly quota of flow runs per user, and we eat into this quota by triggering unnecessary runs. Companies can pool all of their available flow runs together, making them available for the entire tenant. However, there is no reason to waste these runs if they do not need to be triggered.


A Better Solution


What we can do instead, is add a filter directly to the trigger. This will allow us to limit the flow runs to those that already meet our condition and reduce the number of runs triggered.


First, we need to identify what our condition is, and the column/s we want our condition to apply to


If you are unsure of the syntax for your expression, use the expression builder in a variable, then copy and paste that output from the variable.



In this example "Available" is a choice field, hence the need for "?['Value']"

@{equals(triggerBody()?['Available']?['Value'],'Yes')}

Paste it to a notepad temporarily and remove the curly brackets "{}"

@equals(triggerBody()?['Available']?['Value'],'Yes')

On the trigger of the of flow, navigate to the settings menu and find the trigger conditions field:


Now that we have found where to place our condition and what logic we want, we can add it to the Trigger Condition field.



You will notice that you have the option to add multiple conditions to the trigger.

Power Automate will treat multiple conditions as an "AND" statement.


If you want to add an "OR" you will need to add this to a single line of the condition.

@or(equals(triggerBody()?['Listed']?['Value'],'Yes'),equals(triggerBody()?['AvailableSlots'],2))


And now we can test our Trigger condition:

When we change our "Available" value from "No" to "Yes", we trigger our flow. But if we add a new item with the "Available" value as "No", then we will not trigger the flow.


The only issue with this method, is that there can be a delay in triggering the flow, so consider this when deciding how to proceed with designing and building your flow.


In Conclusion


This is a very helpful method for reducing unnecassary flow runs taking place, preventing you from reaching your monthly quota. You will be able to add a vast array of different expressions to this field, including simple expressions or nested IF statements. You will also be able to use this across all popular triggers including SharePoint, Dynamics, Power Apps and many more.

131 views0 comments

Recent Posts

See All

Comments


bottom of page