Author Details

avatar-teacher

Evolvous

We are a team of tech enthusiast and this section is where we love to share our experience and our knowledge. We try our best to help you understand technical topics by giving you live instances of how-to’s, guides, tips, FAQ’s and troubleshoots.

If you like it or have questions, do share your feedback in the comments section below.

Microsoft Power Automate Trigger Condition

It is common to use the ‘When an item created or modified’ trigger when creating flows for SharePoint with Power Automate to perform some actions based on some conditions. Before the Trigger Conditions were released, we need to write a condition to perform the action after flow runs. As a result, we would have Flows running and spending our quota without delivering any value. Trigger conditions protect us from that.

Using trigger conditions, one can control the flow to execute or not. This also prevents generating unnecessary entries in RunHistory.

Let’s discuss your project

How trigger conditions work?

The first thing for us to understand is how the trigger conditions work. Effectively they work in the same way as an expression, whereby we provide it with a function name, some parameters, all done to determine an outcome of TRUE or FALSE.

For example, I need to generate some PDFs based on some values from the SharePoint list. And it should be generated only when all values which are required in PDF should be available then only this flow should be run to generate the PDF.

To achieve this, I have one field in the SharePoint list called “PDF Status” and it has values – “Not Ready”, “Ready to Generate”, “Generated”. When all the fields have proper values in SharePoint List (Field values may updated from another source like PowerApps, Power Automate, etc.) and the value for the “PDF Status” has changed to “Ready to Generate” then our flow will run.

How to configure the conditional trigger in Power Automate? 

Go to the trigger template “When an item created or modified”, click on the three dots, then click on the settings as shown below:

How to configure the conditional trigger in Power Automate - Evolvous

Once we click on the “Settings” we will go to the “Settings for ‘When an item created or modified’” screen as shown below:

﷟HYPERLINK “https://global-sharepoint.com/wp-content/uploads/2020/10/Trigger-Conditions-Specify-one-or-more-expressions-which-must-be-true-for-the-trigger-to-fire.jpg”

Trigger Condition - Evolvous

I only want the automation to run if the field set to “Ready to Generate” Therefore, I will use the function “equals” to check its value.

If you are good with writing expressions, then you can just write it straight into the trigger condition. But if you are not so confident or you want to check whether it’s going to work first, then we can keep it simple and use Power Automate to confirm our logic.

Just add Initialize variable action directly beneath the trigger and then use it to write your expression like below:

Expression : equals(triggerOutputs()?[‘body/PDFStatus/Value’],’Ready to Generate’)

Expression Trigger output - Evolvous

The Variable needs to be of a type Boolean so that we can see whether it is going to return true or false. I will trigger my flow from the SharePoint list, first I will set PDF Status as “Not Ready”, and then set it to “Ready to Generate”.

Once I am sure that the expression is working as I want, I can then take the expression and place it into the trigger condition. The one addition I need is to add the escape character at the start which is the @ symbol. Therefore, my trigger condition will look like below then click on Done.

Trigger Conditions in Power Automate - Evolvous

Once I have set the trigger condition, I can then remove the test variable in the flow. It will only run when it equates to true.

Conclusion:

Automating your business processes with Microsoft Power Automate is a great way to reduce operational costs and increase efficiency. To learn more about why you should be using this technology, contact us today!

I hope you found this blog useful.
Let’s discuss your project

Written by Priyanka Patel

Priyanka is Senior Software Developer at Evolvous Limited – specialists in Microsoft Technologies.