Skip to content

Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Problems
  • Triggers
  • Application specific solutions
    • Excel
    • Forms
    • Planner
    • Outlook
    • SharePoint
    • Teams
  • Resources
Menu

A simple way to create a trigger condition in Power Automate

Posted on March 10, 2021March 30, 2022 by Tom

“I’d like to save flow runs by adding a trigger condition to my Power Automate flow but I don’t know what the actual condition should look like.”


Trigger condition is the solution for a few Power Automate problems. The infinite trigger loop is the biggest one, but it can solve even the small problems, e.g. if your flow is running too often.

If you use a trigger ‘.. is modified’, your flow will trigger with each update. But you probably don’t want the flow to do something on each update. Most of the flow runs will do nothing, they’ll just consume a flow run while waiting for a specific update. And that’s where you can use a trigger condition, if you know how to build one.

Use ‘Filter array’ to create the trigger condition

The simplest way to build a trigger condition I found is to use the ‘Filter array’ action. The action itself is designed to do something completely different, but it offers a nice feature. You can build a condition using the ‘Filter array’ interface and then convert it into an expression with the ‘advanced mode’.

Let’s take an example: a trigger condition to trigger a flow only if choice column ‘ApprovalStatus’ has value ‘Not started’. Add the ‘Filter array’ action into your flow and enter the condition.

Power Automate 'Filter array' condition

Then click on the ‘Edit in advanced mode’, the action will convert the condition into an expression.

Power Automate 'Filter array' advanced mode trigger condition

An expression that you can copy and use as the trigger condition. Once you add the trigger condition, you can remove the ‘Filter array’ action.

Power Automate trigger condition

Combine the trigger conditions

AND

All the trigger conditions on all the lines must return ‘true’ for the flow to trigger. If you need multiple conditions, repeat the same process for each of them and place them on separate lines. The example below will trigger the flow only if ‘ApprovalStatus’ value is ‘Not started’ AND ‘Approver’ is empty.

Power Automate AND trigger condition

OR

It gets a bit more complicated when using OR in the trigger condition. As mentioned above, the lines have AND relation between them. If you need OR you must put everything on a single line. You can still use the ‘Filter array’ action to build the conditions, but you can’t use it directly. You must add the OR condition manually to connect the pieces.

@or(condition1, condition2, condition3,...)

Note: you must remove the @ from the conditions, @ should be only at the beginning.

Using the condition from the example above, ‘ApprovalStatus’ value is ‘Not started’ OR ‘Approver’ is empty.

@or(equals(triggerOutputs()?['body/ApprovalStatus/Value'], 'Not started'),equals(triggerOutputs()?['body/Approver'], null))
Power Automate OR trigger condition

Summary

The trigger conditions might look confusing when you see them for the first time. There’s no dynamic content available, no expressions, it’s just a free text field. But it’s a free text field expecting that you’ll know how to create the trigger condition.

Luckily, like many times before, there’s a way to make your Power Automate life easier. You don’t need to search for the column internal name or for a specific expression, ‘Filter array’ action will do it for you. Create the condition in the user interface, switch to advanced mode, and take it from there.

This post described only the trigger conditions where you’ve got empty/fixed value in a column, but you can use similar trigger conditions also to start a flow on a change in a specific SharePoint column.


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.

19 thoughts on “A simple way to create a trigger condition in Power Automate”

  1. Sebastian says:
    April 14, 2021 at 8:55 pm

    Thank You for Your post!
    What to do when I interested in a free text field change? There is no predefined status to look for, it is just a text box where the users add updates. I wouldn’t start the flow for each modification, just when that given field has changed. Using Your method, I received this:
    “@equals(outputs(‘Get_changes_for_an_item_or_a_file_(properties_only)’)?[‘body/ColumnHasChanged/Requisition_x0020_Notes’], true)”

    Reply
    1. Tom says:
      April 15, 2021 at 9:20 am

      Hello Sebastian,
      to monitor changes in a free text field you’ll need a ‘backup’ column, one extra column where you’ll store the original value and compare it with the ‘main’ free text column on every change. I already wrote a post on this that I believe will explain the solution in more detail: https://tomriha.com/how-to-trigger-power-automate-flow-on-specific-sharepoint-column-update/.

      Reply
  2. Amaury says:
    June 10, 2021 at 4:31 am

    Hello very interesting these points!
    How would a trigger of this type be for an Azure trigger, that is when a work item is updated with the status = CAB Submitted, and the field Crtl Verification = Submitted?

    And subsequently prevent this from running infinitely?

    Thank you very much in advance.

    Reply
    1. Tom says:
      June 16, 2021 at 5:24 pm

      Hello Amaury,
      I didn’t work with Azure triggers so I don’t know if it’s done differently than this.

      Reply
  3. Yvonne says:
    July 23, 2021 at 5:29 am

    Great sharing! This helped me to resolved my issue that I only want my approval flow trigger while the stage & status under specific value and update the stage & status to another value after approval. Thanks for sharing such great solution 🙂

    Reply
  4. Sharon says:
    August 2, 2021 at 3:04 am

    This solution was super simple and worked perfectly, thank you!

    Once I read this section of the page, https://docs.microsoft.com/en-us/power-automate/triggers-introduction#customize-a-trigger-by-adding-conditions , I was concerned. I’m preparing to teach Power Platform to users in a large, global company, and this seemed important! That link didn’t work until I changed the https to http. Meanwhile, I found your article here. Then I reached that other article and it was super complex! I’ve recommended this article as a replacement for it in my feedback suggestion.

    Reply
  5. Nikki G says:
    September 10, 2021 at 10:16 pm

    I would love to hear your thoughts on triggering a flow based on a choice field with multiple selections. Basically, I have a field where people can choose more than one option: Red, Green, Blue. I want the flow to trigger if Red is one of those choices. I cannot figure out how to make that work, even when I use the filter array to build the expression. Any advice is appreciated!

    Reply
    1. Tom says:
      September 15, 2021 at 6:01 pm

      Hello Nikki,
      my thoughts on this are in the new post, I hope it helps.

      Reply
  6. Esteban says:
    September 14, 2021 at 11:55 pm

    The same thing happens to me, I would like to know how to execute a flow depending on a column of options in my case my column of options is quite simple with a YES or NO, but because I do the step of filtering the matrix I cannot make it activate :(, you could find the way?

    Reply
    1. Tom says:
      September 15, 2021 at 6:04 pm

      Hello Esteban,
      I wrote a new post regarding multiple choice columns, but in your case it sounds like a single choice column. In that situation you just need to use the ‘Column Value’ dynamic content when building the condition in the ‘Filter array’ action.

      Reply
  7. Marshall Johnson says:
    September 22, 2021 at 8:03 pm

    This is great! Thank you so much. Very useful.

    Reply
  8. Evolvous says:
    October 28, 2021 at 6:36 am

    Great share. Love your Blog.

    Reply
  9. Chad says:
    December 3, 2021 at 12:20 am

    I’m trying to build a trigger condition on a scheduled trigger. The flow runs weekly, but I only want it to run if the Status column of any item is “Active”. If they are all “Inactive” then the flow should not run. The problem I’m having is the ability to specify the list to reference. I can build the condition based on the above for fields and values(which is great!), but it leaves out the list. A scheduled trigger is not tied to a list, so there is nothing to pull from.

    @equals(triggerOutputs()?[‘body/Status/Value’], ‘Active’)

    Reply
    1. Tom says:
      December 8, 2021 at 9:50 pm

      Hello Chad,
      you’re right, there’s no trigger that would be directly tied to a list, therefore, it’s not possible to build a trigger condition like that. You’ll have to trigger the flow every week and check if there’re any active items as the first step in the flow (and end it if there aren’t any).

      Reply
  10. Simon says:
    May 4, 2022 at 1:44 pm

    Thanks for this. Very helpful and clear. Do you know if you can set a trigger condition to depend on a value in a related entity? E.g. if it was an Income Line, to be able to trigger if the related Income Record (1:1 relationship with Income Line) has a Campaign of a certain value?

    Reply
    1. Tom says:
      May 11, 2022 at 5:59 pm

      Hello Simon,
      you can check two columns in the same item in a trigger condition, but if it’s not possible to use values from different items.

      Reply
  11. Tonie says:
    June 1, 2022 at 4:35 pm

    Hello, my “When an item or a file is modified” trigger already uses Array: @triggerOutputs()?[‘body/value’] and Trigger Condition @contains(triggerBody()?[‘{FilenameWithExtension}’],’.xlsm’).

    I’m trying to use your instructions to add to that, an AND and OR condition. My condition is:
    If Content Approval Status = Approved AND Checked Out = false
    OR
    If Content Approval Status = Denied AND Checked Out = false.

    I see what you mean about how to code it for AND. I get what you mean about how to code it for OR. I’m not seeing how to code it for both AND and OR.

    My trigger condition that is already in there I’m guessing would just be an AND, if I could figure out how to do both.
    @contains(triggerBody()?[‘{FilenameWithExtension}’],’.xlsm’)
    AND
    @equals(triggerOutputs()?[‘body/{ModerationStatus}’], ‘Approved’) AND @equals(triggerOutputs()?[‘body/{IsCheckedOut}’], false)
    OR
    @equals(triggerOutputs()?[‘body/{ModerationStatus}’], ‘Denied’) AND @equals(triggerOutputs()?[‘body/{IsCheckedOut}’], false

    I’m not clear on how to nest the 2 AND conditions in to the OR condition. 🙂

    Reply
    1. Tom says:
      June 12, 2022 at 8:30 pm

      Hello Tonie,
      the relation between rows is always AND, so if you need to combine them with OR then everything must be on the same line. You’ll just have to put it all together using brackets in the right place.
      @or(and(and(, ),),and(,))

      Reply
  12. Deanna says:
    June 14, 2022 at 5:10 pm

    This is a lifesaver-thanks!

    Reply

Leave a Reply Cancel reply

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

Now available:

The Ultimate Power Automate expressions cheat sheet
Equip yourself with the tool to translate your thoughts into Power Automate expressions!

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.

Hello and welcome!

My name is Tom and I'm a business process automation consultant and Microsoft MVP living in the Czech Republic. I’ve been working with Microsoft technologies for almost 10 years, currently using mainly Power Automate, SharePoint, Teams, and the other M365 tools.

I believe that everyone can automate part of their work with the Power Automate platform. You can achieve a lot by "clicking" the flows in the designer, but you can achieve much more if you add a bit of coding knowledge. And that's what this blog is about.

To make the step from no-code Power Automate flows to low-code flows: using basic coding knowledge to build more complex yet more efficient flows to automate more of your daily tasks.

  • Format results of date calculation in SharePoint columnJune 29, 2022
  • Why is your Power Automate flow creating duplicatesJune 26, 2022
  • How to create a unique identifier in your Power Automate flowJune 22, 2022
  • How to assign custom SharePoint permission level with Power AutomateJune 19, 2022
  • Remove permissions from a specific SharePoint user with Power AutomateJune 15, 2022

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

© 2022 Let's POWER Automate | Powered by Superbs Personal Blog theme