Power Automate SharePoint Get Column Changes

With the Get Changes Action in Power Automate we can determine if a column has changed in your SharePoint list or library. But how do we determine what the value was before it changed?  There are a couple extra steps needed in order to figure out what the previous values were. I outline the steps to accomplish this below and walk through it all in the corresponding video.   

Step 1:  In your new flow make sure you have the “When an item or a file is modified” trigger.  Right below that add a “Get changes for an item or file” action.  Point both of the trigger and action to your SharePoint site and list or library.  For the Get changes for an item or file action make sure to use the “Trigger Window Start Token” dynamic property in the “Since” field.

Trigger and Get Changes Set Up

Step 2: Insert a Send an HTPT request to SharePoint action. This is what we have to use to get the previous value. We’re going to use the version history to look up a specific version of an item. Point it to your SharePoint URL and choose “GET” from the Method dropdown. Enter the following for the URI property (replacing the text in getbyTitle with your list name):


_api/web/lists/getByTitle(‘Asset manager’)/items(@{triggerOutputs()?[‘body/ID’]})/versions(@{outputs(‘Get_changes_for_an_item_or_a_file_(properties_only)’)?[‘body/SinceVersionId’]
})

SharePoint HTTP Action

Step 3: Add a condition and use the “Has Changed:” dynamic properties for the value that you wanted to test if it changed and do is equal to true. Inside of the “yes” section of the condition you’ll add a Compose action and this is where we will get the previous value which can then be used in other spots in the flow. Here’s the formula you’ll need to put in the Expression editor to get that (replace the last bracket value with your field name):

body(‘Send_an_HTTP_request_to_SharePoint’)[‘d’][‘Status’]

🔗 Links 🔗
Download the Flow: https://github.com/aprildunnam/Power-Automate/blob/master/GetItemChanges_20210512003702.zip

6 thoughts on “Power Automate SharePoint Get Column Changes”

  1. I just found your site and started looking through and really like it. I appreciate you hard work, thank you for sharing.

    If you ever want feedback about typos etc read on. This was likely typed in a hurry: “Step 2: Insert a Send an HTPT request to SharePoint action. This is what we have to use to get the previous value”.

  2. I followed exactly and this was my input:
    “_api/web/lists/GetByTitle(‘SPF RAID’)/items/(75)/versions(3.0)”

    But got this error:

    errors”: [
    “-1”,
    “Microsoft.SharePoint.Client.InvalidClientQueryException”
    ]
    }

  3. Hi. Great information. I tried to replicated, but got an error in the Send an HTTP Request. I get this message ” Input string was not in a correct format.”
    The uri in the INPUT is this one ” _api/web/lists/getByTitle(‘LIST MACD’)/items(3)/versions(15.0) “, but the output says Status code 400,

    “status”: 400,
    “message”: “Input string was not in a correct format.\r\nclientRequestId: b628c0ab-b896-46a5-b71f-ee2897b5b6a1\r\nserviceRequestId: 9f8f66a1-1073-6000-f52f-b87fb788b94d”,

    What I’m missing here? I’ll appreciate all the help.. Thank you.

  4. Thank you for this tutorial, it helped a lot. Though I had to additionally wrap the outputs(‘Get_changes_for_an_item_or_a_file_(properties_only)’)?[‘body/SinceVersionId’] in an int() function because the flow was failing with an “Input string was not in a correct format” error. Maybe someone will find this tip helpful.

Leave a Comment

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

Scroll to Top