Power Automate Trigger Conditions: Explained with Examples

by | Power Automate

Imagine for a moment that you’re a maestro, ready to orchestrate a symphony of tasks — a tantalizing tune of productivity. Your baton? Power Automate. Your sheet music? Flows. But just like how every melody needs a starting note, every flow needs a trigger.

Power Automate trigger conditions are specific stipulations set within a Power Automate flow that determine when that flow should be initiated. Essentially, these conditions serve as a “gate” for the initiation of a process, only opening when certain criteria are met. The criteria can be as simple as a certain date and time, or more complex, like an email being received with a specific subject line

In this tutorial, we’ll discuss Power Automate trigger conditions that allow us to execute blocks of actions once a given situation is met. Using condition control, we can assure that certain elements in our flow are in our required state before performing the actions.

Let’s get started!

Table of Contents

What Are Power Automate Trigger Conditions?

Power automate trigger conditions

Power Automate is a versatile tool developed by Microsoft that’s aimed at streamlining repetitive tasks and boosting efficiency in organizations of all sizes.

Central to the successful implementation of Power Automate workflows, also known as “flows”, are components called “triggers.” A trigger in the Power Automate context is an event that initiates the execution of a workflow. In other words, a trigger is a condition that, when met, sets a flow into motion.

Think of triggers as the starting point or the first step of any flow. They essentially monitor for specific events, and when these events occur, they “wake up” the flow to start its operation.

For example, a trigger condition could be something as simple as the arrival of an email in your Outlook inbox, a new row added to an Excel spreadsheet, or a new item being added to a SharePoint list. Triggers can also be more complex, monitoring multiple conditions across different applications.

A trigger condition in Power Automate is similar to an IF statement in Excel or in any other programming language. It splits our flow into two pathways based on a condition.

How to Set Up Triggers in Power Automate

Setting up triggers in Power Automate is a straightforward process that can be mastered with a bit of practice. This section will guide you through the steps to set up both simple and complex

Here’s a step-by-step guide to setting up a simple trigger in Power Automate:

1. Sign in to Power Automate: Visit the Power Automate site and sign in with your Microsoft account from the upper-right corner.

sign in to power automate

2. Create a new flow: Click on “Create” on the left side of the screen and choose the type of automated flow you want to create, such as an “Automated cloud flow” with an automated trigger.

Choose an automated cloud flow with a designated trigger condition

3. Choose your trigger: In the “Choose your flow’s trigger” box, select the application and then the specific trigger you want to use. For instance, you might choose “When a new email arrives” for Outlook as your only trigger.

Power automate trigger condition

4. Configure your trigger: Based on the trigger you selected, you may have to configure some additional details. For an email trigger template, you might need to specify a particular folder in your inbox.

Configure the trigger body

5. Set an action and save your flow: Once you’ve set up your trigger, click “+New step” to choose an operation for when the trigger condition is triggered.

Add an operation that'll come after your trigger's settings are fulfilled

Hit “Save” and voila! Your flow run is ready! But make sure you test it first to confirm it works as expected before. There’s a “Test” button at the top-right corner of the page.

If all of the above sounds too easy, don’t worry! We’re going to go over how you can set up multiple trigger conditions in the next section.

Adding Multiple Trigger Conditions in Power Automate

For this section, we’ll use a sample flow we’ve created beforehand. In this sample flow, we’ll receive an email notification once a user posts a tweet that contains the words “Power Automate”.

Then, we’ll add a condition where if the word “issue” is found on the tweet, it will create a Trello card. Otherwise, it’ll just retweet that specific tweet and it won’t create a Trello card. 

1. To add a condition, let’s add another step by clicking the New step button.

Add another step by clicking "New step"

2. Then, click Control.

Click "Control" to add a new trigger condition

3. After that, let’s add a trigger condition by clicking Condition Control.

Add a trigger condition by clicking "Condition Control"

4. We then need to set the values for our condition. 

Set the values for our condition

5. If the condition is true, then it goes down to the If yes pathway. Otherwise, it will go to the If no pathway. We can also set the actions here based on the condition output. 

Choose conditions for your "If yes" and "If no" pathways

6. On our Trello board, let’s add a new section and name it “Issues“.

Add a new section in your Trello board and name it "Issues"

7. For our condition, let’s use the Tweet text variable for our true statement.

For the condition, make use of the Tweet text variable if the statement is True

8. Again, we want to see if the tweet has the word “issue”. So, let’s use “contains” in this part.

Use the "contains" parameter to find out if a tween contains the word "issue"

9. For the third field, let’s add the word “Issue”. We need to add a quotation because it’s a string, not a variable.

For the third field, add the word "Issue"

10. We can add multiple conditions by clicking the + Add button. For this example, let’s add another row. 

You can add as many trigger conditions as you like using the "+ Add" button

11. We can also choose between the “AND” and “OR“ conditions.

You also have the option to choose between "AND" and "OR" conditions

12. For an “AND“condition, both of the arguments have to be true for it to be passed to the If yes section. If it’s an OR condition, either of the statements should be true.

For the "AND" condition, make it so that both arguments have to be true before being passed

13. For this example, we’ll use the OR condition.

For our example, we'll use the OR condition

14. For the second condition, let’s use the Tweet text variable, then set the condition as “contains” and add the word “Problem”.

Use Tweet text variable for the second condition

15. Let’s now add an action if our condition results to true. Remember that we want to create a Trello card if the tweet meets either of the conditions. Therefore, we can just drag the Create a card action to our If yes section.

Add an action for if our condition results to true

16. Now, let’s add an action to the If no section if the tweet doesn’t meet any of the conditions. Just click the Add an action button.

Add an action for if our condition results to false

17. Let’s look for the Twitter connector and click on it. 

Look for the Twitter connector

18. Then, click the Retweet action.

Click the Retweet action

19. For the Tweet id, let’s use the Tweet id variable.

For the Tweet ID, use the Tweet ID variable

We’re now done setting up our flow. When a new tweet is posted, it’ll first send us an email notification. Then, it’ll look at the condition that we’ve set to analyze if it should either retweet the tweet or create a Trello card.

There are a lot of moving parts in our flow, and it’s important to test it to make sure it works as expected. In the next section, we’ll go over how you can test multiple trigger conditions in Power Autoamte.

Testing Multiple Trigger Conditions in Power Automate

Let’s now test our condition. This time, let’s perform a manual trigger instead of using the data from our previous runs.

Testing using a manual trigger

1. We’ll tweet “Power Automate has an issue :(”.

2. Our flow is now running in the background and looking for a tweet that will meet the search term and conditions that we’ve set.

The flow runs in the background to create desired outcomes

3. We can check the output once our flow test runs successfully. As we can see, the result was false even though our tweet contained the word “issue”.

Result of the automated flows

4. This is probably because in our tweet, we wrote the word “issue” with a small “i”.

Tweet for our test variable

5. But on our condition, we specified the word “Issue” with a capital “I”.

Our example uses "Issue" with a capital "I"

This is a good point to go over how you can convert strings in your trigger conditions to lowercase so that they work as expected. So let’s discuss how in the next section!

Converting Strings to Lowercase in Trigger Conditions

What we need to do is to convert these Tweet text variables to lowercase. This is to make sure that even though the tweet has a small or capital letter, it’ll all be treated as a lowercase.

To do that, instead of using a variable in this part, we need to convert it into an expression. So, let’s remove the Tweet text variable.

Remove the tweet text variable

Let’s use an expression called toLower. The toLower expression converts texts into a lowercase format.

Use the function toLower

Let’s add parenthesis and put the Tweet text variable inside.

Put the tweet text variable inside

Then, let’s click the OK button.

Click OK to finalize your changes

Let’s also do similar steps with the second condition.

Repeat the process for the second condition

Then, change the “Issue” and “Problem” texts to lowercase.

Chat the "Issue" and "Problem" texts to lowercase

Alright, now that that’s out of the way, let’s retest our trigger condition!

Retesting the Trigger Condition

Save this flow and let’s make another test. Again, we’ll perform a manual trigger for this test.

Perform a manual trigger for this test

This time, let’s tweet “There’s a Problem with Power Automate.” We’ll use a capital “P” for the word “problem” to see if our expression will work.

Right the test tweet

Let’s now check the result. As we can see, the result is now true because the tweet contains the word “problem”. We’ve used a capital “P” but the result is still true as it was converted into lowercase. Our expression is now working properly.

The restul is true

Since the result is true, it should now be added to our Trello board as a card. We made a mistake here because we should have changed the section to Issues instead of Twitter, but it’s fine for now.

Result on Trello board

Let’s click on this card and we’ll see that it recorded our tweet that says “There’s a Problem with Power Automate” into the Description.

Tweet shows "There's a Problem with Power Automate"

Success! The flow worked as expected and the result is recorded in the Trello board. Hopefully, this example has given you a glimpse of the potential of Microsoft Power Automate trigger conditions.

With the right types of triggers, you can set up any type of flow you can think of! In the next section, we’ll go over the types of triggers that can be set up in Power Automate.

Types of Triggers in Power Automate

Microsoft flow trigger condition types

In Power Automate, triggers are categorized into different types based on their characteristics and the way they initiate the execution of a flow. Understanding these trigger types can help you build more efficient and effective workflows.

Let’s delve into the three main types of triggers available in Power Automate: Scheduled, Automated, and Instant Triggers.

1. Scheduled Triggers

Scheduled triggers are set to initiate a flow at specific times. You can customize these to run your flows at regular intervals — such as hourly, daily, weekly, or monthly — or at a specific time on a certain day.

This type of trigger is particularly useful for routine tasks or business processes that need to occur at predetermined times and need an infinite trigger loop.

For example, you might set up a scheduled trigger to run every Monday morning to compile and send a report, or run every first day of the month to archive old data in an infinite loop.

2. Automated Triggers

Automated triggers are designed to initiate a flow in response to an event or a change in the system or an application. These triggers continuously monitor for a specific event and, once that event occurs, they trigger the flow.

For instance, an automated trigger could be set to initiate a flow whenever a new file is uploaded to OneDrive, a new row is added to an Excel spreadsheet, or when a new email arrives in a specific Outlook folder.

Automated triggers are great for setting up reactive processes that depend on changes or updates in your applications. For example, you could set up automated trigger conditions protect against unexpected changes to your SharePoint document library.

3. Manual Triggers

Manual triggers or instant triggers are initiated by a manual action. These triggers allow a flow to be started on-demand when a user performs a specific action.

For example, you could create a flow manually to send a formatted email to a designated recipient when it is manually triggered by you. The flow won’t run until you click a button in Power Automate’s mobile app or from the Power Automate website. Instant triggers provide the flexibility to control precisely when you want your flow to run.

Alright, we’ve covered a lot of ground so far. For our final section, we’ll go over best practices for setting trigger conditions in Power Automate.

Best Practices for Setting Trigger Conditions in Power Automate

Best practices for trigger conditions

One of the critical aspects of mastering Power Automate is understanding how to effectively set trigger conditions. These conditions determine when a flow should run, making them a pivotal part of your automation.

To maximize your efficiency and avoid common pitfalls, consider these best practices for setting trigger conditions.

1. Be Specific with Triggers

Avoid setting triggers that are too broad or generic, as this can lead to unnecessary flow runs. For instance, if you’re monitoring an email inbox, setting the trigger to ‘When a new email arrives’ might cause the flow to run more often than necessary.

Instead, consider adding conditions to check for specific senders or subject lines to ensure your flow only runs for relevant emails.

2. Use Expressions for Advanced Conditions

Power Automate allows you to use expressions to create more complex conditions. Expressions can perform functions, manipulate strings, and carry out mathematical operations. They are an excellent tool for creating sophisticated and precise trigger conditions.

Ensure you familiarize yourself with the syntax and capabilities of expressions to leverage their power effectively.

3. Optimize Flow Performance with Conditions

Trigger conditions can greatly affect the performance of your flow. Unnecessary flow runs not only consume resources but can also slow down the execution of other tasks. Use conditions to filter out irrelevant trigger events and reduce the load on your flow.

4. Test Your Trigger Conditions Thoroughly

Always test your trigger conditions before deploying the flow. This will help identify any errors or inefficiencies in the conditions.

Power Automate provides options to test your flow with past data or by performing the trigger action manually. Use these options to validate your conditions and ensure they work as expected.

5. Use Comments and Descriptive Names

Good documentation practices are as important in Power Automate as in any other coding or scripting environment. Use descriptive names for your flows and steps to make it easier to understand what they do.

Use comments to explain complex conditions, especially when using expressions. This not only helps others understand your flows but also makes it easier for you to manage and update them.

6. Stay Within Plan Limits

Each Power Automate plan has its own limits, including the number of runs per month and the frequency of checks for certain triggers. Be aware of these limits when designing your flows and setting your trigger conditions to avoid exceeding them.

Setting trigger conditions is a delicate balance between specificity and flexibility. By following these best practices, you can create efficient, effective, and reliable flows that will automate your tasks and improve your productivity.

Final Thoughts

Microsoft power platform power automate tutorial

Power Automate, when used effectively, can automate repetitive tasks, streamline complex workflows, and unlock efficiencies within your organization.

Mastering trigger conditions is a fundamental part of this process, allowing you to create intelligent, responsive flows that adapt to your unique needs.

By understanding and effectively utilizing trigger conditions, you can tailor your automation to a granular level, allowing your flows to react to specific circumstances and deliver highly customized results.

It might take some time and experimentation to fully grasp the intricacies of triggers and conditions, but the rewards in terms of time saved and efficiency gained are significant. Embrace the power of automation, and let it drive your productivity to new heights!

If you’d like to learn more about how Power Automate can aid your workflow, check out this video:

Frequently Asked Questions

Programmer working on Power Automate

How do you write trigger conditions in Power Automate?

In Power Automate, you write a trigger condition by first selecting a trigger for your flow, then defining the condition under the settings of the trigger. This condition is written in the Workflow Definition Language, where you specify a property of the trigger to check, a comparison operator, and the value to compare it to.

For example, you could add a condition to the ‘When a new email arrives’ trigger to only activate when the email is from a specific sender. This would be written as:

 @equals(triggerOutputs()?['body/from'], 'example@example.com')

triggerOutputs()?[‘body/from’] is the property (the email sender), @equals is the comparison operator, and example@example.com is the value. To learn more, try following power automate tutorials.

How do you add trigger conditions to a flow?

In Power Automate, to add a trigger condition to a flow, you start by creating or editing a flow and selecting a trigger. After that, you go to the settings of the selected trigger and configure trigger conditions in the “Trigger Conditions” field.

In this field, you write an expression in the Workflow Definition Language that defines your condition. This expression typically checks a property of the trigger output using a comparison operator and a comparison value.

Once you’ve written your condition, save the settings and the flow. Now, the flow will only run when the trigger event occurs and the condition is met.

How do you test trigger conditions in Power Automate?

In Power Automate, testing a trigger condition involves using the “Test” function built into the platform. After you’ve created your flow and defined your trigger condition, save the flow, and then click on the “Test” button in the top right corner of the flow editor.

You’ll be given the option to manually perform the trigger action or use data from previous runs. If you choose to manually perform the trigger action, the flow will run when you carry out the action that triggers it, allowing you to test whether the trigger condition is working as expected.

If you choose to use data from previous runs, the flow will run using the data and conditions from a past instance, which can be useful for testing without needing to manually trigger the flow.

Related Posts