DEV Community

Cover image for Power Automate: How to trigger a flow only when specific field(s) have certain values
Frederik Van Lierde
Frederik Van Lierde

Posted on

Power Automate: How to trigger a flow only when specific field(s) have certain values

What is Power Automate

Power Automate is a tool that helps you automate tasks and workflows across your favorite apps and services, without needing any coding skills.

With Power Automate, you can streamline processes, integrate different apps, and automate routine tasks, so you can focus on more important things.

Whether it's sending emails, updating spreadsheets, or triggering notifications, Power Automate makes it easy to automate everyday tasks and boost productivity.

What are Power Automate Triggers?

Power Automate Triggers are like the starting points for your automated workflows. They're the events or actions that kick off a series of tasks or actions within Power Automate. Think of them as the "if this happens, then do that" moments in your workflow.

For example, a trigger could be receiving an email in your inbox, a new file being added to a folder in OneDrive, or a new tweet being posted. These triggers are what signal Power Automate to start running your automated process.

Once a trigger is activated, Power Automate can then perform a sequence of actions, like sending an email, creating a new record in a database, or updating a spreadsheet. Triggers are essential because they determine when your automation begins and what actions it should take based on certain conditions or events.

How to trigger a Power Automate flow ONLY when a specific field has a certain value?

Let's say you're managing a project using a SharePoint list to keep track of tasks, deadlines, and team members.

You want to be instantly notified whenever a task status changes to "Ready To Test" in that list. You don't want the flow to be triggered when a new item is created, or other fields are updated

With Power Automate, you can set up a trigger that activates a workflow whenever a specific column, like "Task Status," is modified in your SharePoint list.

The SharePoint List

The SharePoint List

The Power Automate Flow

  1. Create a new Flow
  2. Add as Trigger "When an item is created or modified" (SharePoint Action)
  3. Select your SharePoint and List Name

Power Automate SharePoint Trigger

  1. Go to Settings
  2. Add you trigger. In our example, we check if the column Task Status is modified to Ready to Test

Power Automate SharePoint trigger settings

@equals(triggerOutputs()?['body']['TaskStatus']?['Value'],'Ready to Test')
Enter fullscreen mode Exit fullscreen mode

Our Task Status column is a choice column with 4 choices.
You can also use the ID of the choice instead of the Text

@equals(triggerOutputs()?['body']['TaskStatus']?['Id'],2)
Enter fullscreen mode Exit fullscreen mode

How to trigger a Power Automate flow ONLY when a 2 columns have a certain value?

In out example, let's add a column Signed Off which is a Yes/No column and we want the flow only executed when Task Status is 'Ready to Test' and Signed Off is true

The solution is to use the and function

@and(equals(triggerOutputs()?['body']['TaskStatus']?['Id'],2),equals(triggerOutputs()?['body']['SignedOff'],true))
Enter fullscreen mode Exit fullscreen mode

Extras

  • Instead of using the and function you can also use the or function
  • This solution also work for LookUp and Calculated Columns
  • In case the user creates a new item, and set the specific fields to the certain values, the flow will work as well.
  • You can add more columns and make it as complex as needed

Top comments (1)

Collapse
 
miglena_petrova_d9c6b3199 profile image
Miglena Petrova

Hi :) thank you for the article! I was wondering if there is a way to set a trigger to send me an email if I haven't completed an action within a month? For example the date in the field is 01 Jan 1025. If I haven't completed the task (and therefore changed the date to when I completed it e.g. 25 Jan 2025) by 31 Jan 2025, it sends me a reminder. Is that possible?