Looking for PowerObjects? Don’t worry, you’re in the right place! We’ve been part of HCL for several years, and we’ve now taken the final step in our acquisition journey: moving our website to the HCL domain. Nothing else is changing – we are still fanatically focused on Microsoft Business Applications!

PowerObjects Blog 

for Microsoft Business Applications


Shortcut to building trigger conditions in Power Automate 

Post Author: Blake Newhouse |

Background 

In a Power Automate (flow), we can limit when the flow is triggered using several different methods. This blog post will highlight two methods a maker can employ to limit flow runs using trigger conditions. Using trigger conditions allows a maker to create multiple conditions that must be met for a flow to be triggered. Please note that if a flow’s trigger conditions are NOT met, the flow will not be triggered, and no run history will be logged.  

Option 1 – Filter rows conditions on the trigger action:  

A maker can limit a flow’s triggering via the Filter Rows property under Advanced Options of the trigger step.

Here we use an oData query statement to control when the flow triggers. This option can be difficult to implement and usually only allows a single filter. Using an AND or OR operator to combine conditions will most likely not work. Therefore, let’s explore an alternative and easier method for combining multiple trigger conditions, described in Option 2 below.  

Option 2 – Set trigger conditions on the trigger action:  

A maker can limit a flow’s triggering via the settings of the trigger component. Please see the step-by-step instructions below.  

  1. Click on the plus sign under the trigger component and click Add an action to add a new step
  2. Type “filter array” in the search box and then select the action from the results
  3. Once the Filter array action is created, add your required trigger condition. Ignore the From field as we won’t be saving this step. We’ll only be using it to compose our filter criteria.  
  4. Click Edit in advanced mode and copy the text in the textbox
  5. Now that we have the correct syntax for our first filter, we need to paste it into the settings. To do that, click on the ellipsis in the upper right corner of the trigger component
  6. Click Add and paste the clipboard contents into the trigger condition field.  

If you have multiple filter conditions to add, you can click the +Add button and repeat steps 3-4 above to generate the properly formatted conditions. However, if you need to have OR logic, you need to put that in one line like this: @OR(test1,test2,test3). Note that we drop the leading @ of each string and put that at the beginning.  

For example, if we wanted to have our trigger filter if a task  

  • has a subject,  
  • and the due date is > today  
  • and the status is not canceled,  

our syntax would look like this (carriage returns added for readability):  

@or(@greaterOrEquals(triggerOutputs()?['body/scheduledend'], utcNow()), 

equals(triggerOutputs()?['body/subject'], null), 

not(equals(triggerOutputs()?['body/statecode'], 2))) 

Finally, once you have completed the setup of the trigger conditions you can delete the filter array option and complete any additional steps required for your flows use case.  

Joe CRM
By Joe D365
Joe D365 is a Microsoft Dynamics 365 superhero who runs on pure Dynamics adrenaline. As the face of PowerObjects, Joe D365’s mission is to reveal innovative ways to use Dynamics 365 and bring the application to more businesses and organizations around the world.

Leave a Reply

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

PowerObjects Recommends