Skip to content
Tutorials Center
My learning

Topics

Lesson 9 of 38 ยท Flows and Triggers

Trigger Conditions, Filter Queries and Reducing Runs

Stop unwanted flow runs with trigger conditions, OData filter queries and connector filters, write conditions with equals, and, or and not, and test them safely.

Every run costs quota and clutters history. The cleanest flow is one that starts only when it has real work to do. Power Automate gives you three layers of filtering, from the cheapest to the most flexible: connector parameters, filter queries and trigger conditions.

Layer 1: connector parameters

Many triggers expose parameters that the service applies itself. Examples are the Folder, From, Subject Filter and Importance of the Outlook email trigger, or the Site Address and List Name of SharePoint triggers. Use these first. They need no expressions and the service does the filtering.

Layer 2: filter queries

Some triggers (Dataverse Filter rows, SharePoint Get items, and others) accept an OData expression that the service evaluates.

TEXT
status eq 'Open' and priority gt 2
startswith(title,'INV')
createdon ge 2025-01-01T00:00:00Z

Operators you will use: eq, ne, gt, ge, lt, le, and, or, not, and functions startswith, endswith and contains (support varies by connector). Strings use single quotes, and the column name must be the internal one. Check the connector documentation, because OData support is not identical everywhere.

Layer 3: trigger conditions

When the previous layers are not enough, open the trigger's three-dot menu, choose Settings, and in Trigger Conditions add an expression that returns true or false. The run is created only when the condition is true. Each condition starts with @ and uses workflow expressions.

TEXT
@equals(triggerOutputs()?['body/Status/Value'], 'Approved')
@not(equals(triggerOutputs()?['body/Editor/Email'], '[email protected]'))
@and(greater(triggerOutputs()?['body/Amount'], 1000), equals(triggerOutputs()?['body/Region'], 'EU'))

triggerOutputs()?['body/...'] reads a field from the trigger. The ? makes the access safe when the field is absent. You can add several conditions; all must be true.

A skipped item appears nowhere in run history, which is the point, but it also means that a wrong condition is silent. If your flow never runs, check the conditions.

Comparing the three

Layer Evaluated by Strength Weakness
Connector parameter Service Simple, fast Only offered fields
Filter query Service Powerful OData Syntax varies
Trigger condition Power Automate Any expression Evaluated after the poll, skip is silent

Logic functions you need

These are described fully in Expressions first steps; the key ones for conditions are equals, not, and, or, greater, less, contains, startsWith, empty and if.

Note that equals is not case sensitive for strings in all situations, but contains and startsWith follow their own rules. When case matters, normalize with toLower() on both sides.

Practising conditions with a stand-in

This Python stand-in evaluates conditions against sample trigger data and prints whether a run would start. The functions mimic the logic of equals, and, not and so on. It is not the real expression engine.

Python Stand-in: which items would start a run?

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Only the first item runs. Item 3 is ignored because the flow's own account edited it, which is a standard trick to avoid loops (see Automated flows and triggers).

Building an OData filter safely

Filter queries are strings. A value with an apostrophe breaks the query, so double the apostrophe. This stand-in builds a filter safely.

Python Stand-in: building an OData filter string

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Testing conditions

  1. Save the flow with the condition.
  2. Create a matching item and a non-matching item.
  3. Confirm only the matching one starts a run.
  4. If nothing starts, temporarily remove the condition to confirm the trigger itself works, then reintroduce it and compare against the trigger output from a successful run (open the run and copy the trigger outputs).

Common mistakes

  • Using a display name of a column in triggerOutputs() instead of the internal name.
  • Choice columns return an object, so use .../Status/Value rather than .../Status.
  • Forgetting the leading @ in a trigger condition.
  • Testing a condition on data that never changes, so the trigger does not fire.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is the cheapest way to avoid unwanted runs?

    Filtering at the trigger means the flow never starts, which saves quota and keeps history clean.
  2. 2. What does a trigger condition return?

    The run is created only when every trigger condition evaluates to true.
  3. 3. How do you read a field from the trigger in an expression?

    triggerOutputs() returns the trigger's data, and the safe-navigation index reads the field.
  4. 4. How is an apostrophe in a value written inside an OData string?

    OData doubles single quotes inside string literals, as in 'O''Brien'.

Summary

  • Filter in three layers: connector parameters, OData filter queries, trigger conditions.
  • Trigger conditions are expressions starting with @ that decide whether a run starts.
  • A skipped event leaves no run history, so test both matching and non-matching data.
  • Escape apostrophes and use internal column names.

Next: HTTP request and webhook triggers