Flow when a SharePoint Column is updated

In Microsoft Power Automate, you can create a flow that can take action based on specific columns being updated in SharePoint!  This can be done on a list or library.  There is an action called Get changes for an item or a file, which gives you a boolean for each field, whether it was just changed or not.

Here’s how to use: Get changes for an item or a file

In my example, I have a list of projects, and I only want the project completion email to be sent when someone changes the project status column to completed.

First of all, these steps assume that you have prior SharePoint and Power Automate knowledge.  Here are my classes if you’d like to ramp up.

1.  Make sure that versioning is turned on in your list or library. This can be found in the versioning settings in the list/library settings.

2.  Create a new flow.  Use the trigger called When an item or a file is modified. Pick your site and list.
sharepoint-when-file-item-modified-trigger

2.  Add the action called Get changes for an item or a file (properties only).

3.  Pick your site and list.  For the ID field, pick the ID from the trigger.

4.  There is a box called “Since”.  This lets you tell the workflow which changes to compare.  If you want to know which fields have been changed since the item was first created, you’d just type 1.0 in this box.  But in this example, I want to know what just changed in this item, so I’m going to subtract 1 from whatever the current version is.  Use the following expression using the expression builder.  The int fuction ensures that you’re looking at the version number as an integer, and sub does the subtraction.

sub(int(triggerOutputs()?[‘body/{VersionNumber}’]),1)

sharepoint-get-changes-for-an-item-or-a-file-action-flow

5. Since I specifically want to know if the status has just been changed in this latest modification, I can use a condition to check that.  My column is called project status, so I select Has Column Changed: Project Status and is equal to, true.

has-status-column-changed

6.  Now what would you like to happen if the status has just been changed?  That part is up to you.  Maybe you need to send an email or create a task, whatever your business process requires.  Put these next actions in the If yes section after the condition.

BONUS

If you would like to narrow down when your flow gets triggered, and set it up to not even trigger at all if it doesn’t have a status of completed, that can be done as well, in addition to the steps you added above.  Go to the trigger’s settings.

flow-sharepoint-trigger-settings

Add a trigger condition, here at the bottom.  You can see here that I’ve written an expression that is a filter.  Therefore, the flow won’t trigger at all unless the project status is completed.  Then, once it triggers, the condition in the workflow looks to see if the status was just changed in the modification.

flow-trigger-settings-trigger-condition

To learn more about flows with Power Automate, and details about triggers, check out my course on my training site at IW Mentor.

4 comments

  • Funny you should post this now. I just watched a video on this same subject in the corporate site of the company I do work for! While the video was helpful, I appreciate your post as something I can refer back to (and probably will) when this subject comes up again. Thanks Laura!

    Like

  • Ran across your video when you created a flow to pull the Employee Directory into a SharePoint list – It grabbed all direct reports – it’s exactly what I am trying to accomplish. The only issue I am having is how to get the employee photo and I can’t seem to find anyone who can explain how to do this action. I thought you said in the video that it was doable – can you point me in the right direction? Thanks much! Robin

    Like

  • Thank you! Works great 🙂

    Like

  • Hi, Not sure what i’m doing wrong but when i enter “sub(int(triggerOutputs()?[‘body/{VersionNumber}’]),1)” as an expression in the “Since field” i get an error “The expression is invalid”. I pasted it direct in. Thanks

    Like

Leave a reply or question

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.