Recently the Get changes for an item or file action was added to SharePoint. Here a full overview

Get changes for an item or file action

The Get Changes for an item or file action will require your list or library to have versioning enabled. If you don’t have versioning enabled you will see the following error message:

Versioning not enabled for list

You can enable Versioning in the list or library settings

Nothing complicated here. Be aware however that the versioning settings will affect the functionality in your flow. So for example the number of versions kept will be important for your flow.

Once enabled the action will now work and return data.

At the end of the long list of true/false values there is a short overview in json, which is a bit easier to use. Here we can see that I updated the column with the name Choice

So now we know the fields that have changed but we don’t really know what they changed to or from.

Versions of items or documents

When you look through the dynamic properties, you will very quickly bump into the Since Version Number and until Version number

These give you the range of version numbers that the flow has checked.

Now if only we could get to the data of a version number of data in SharePoint!

Well we can. but it might not be as easy has you hoped for

You will need to build up the following configuration for the Send an HTTP request to SharePoint action.

I’m now going to use the SinceVersionId to query the versions of the list item that was changed and that triggered my flow.

I can do that with the following expression. Note that this is SinceVersionId and not SinceVersionLabel.

outputs('Get_changes_for_an_item_or_a_file_(properties_only)')?['body/SinceVersionId']

How to get the previous values?

We now need to have another look at the Get changes for an item or a file action

If we now configure the Until field to get its date from the Modified date of the trigger minus one second. Then we know that we have the previous version of the item and the job is done!

Share
Pieter Veenstra

Business Applications and Office Apps & Services Microsoft MVP working as a Microsoft Productivity Principal Consultant at HybrIT Services. You can contact me using contact@veenstra.me.uk.

Recent Posts

Create Distinct filters for Power Apps galleries

So you add a gallery to your app in Power Apps and you want to…

2 days ago

Send push notifications to start your app in Power Apps

Have you ever wanted to send push notification to people's phones to run a Power…

7 days ago

Patch the Common Data Services with Power Apps

Using the patch Function to update records in the Common Data Services can be easy,…

1 week ago

Deploy Canvas Apps and Flows through solutions

When you deploy Canvas Apps and Flows in Power Apps and Power Automate you can…

2 weeks ago

Address Input in Power Apps

When you app needs users to input addresses, you can now use the Address input…

2 weeks ago

Just 3 clicks to disable an action in Power Automate

Have you ever wanted to disable an action in your Power Automate flow? It is…

3 weeks ago
%%footer%%