cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Power_Automater
Helper I
Helper I

Comparing list item versions in a Recurrence flow

I have a Recurrence flow setup that checks once per day if certain items in a SharePoint List have been modified and compiles these into a single email. I use a filter array to compare the modified date with the current date:

 

formatDateTime(item()?['Modified'], 'yyyy-MM-dd') Is Equal To formatDateTime(utcNow(), 'yyyy-MM-dd')

 

I would like to add another check (perhaps second filter array?) to compare whether the current and previous versions of the item is the same so that I'm not sending updates if it hasn't changed. If I was using the "When an item or file is modified" trigger this would be straight forward, but I need the recurrence in place to be able to compile the changes rather than send emails for each one separately. Is there an Action or Expression I could use to check for this?

1 ACCEPTED SOLUTION

Accepted Solutions

You have to retrieve the metadata for the previous version and then compare the specific fields you want to compare.  There is no way that I know of to compare the actual records directly.  To retrieve the values in the previous version it would be the following REST call

_api/web/Lists/getbytitle('MyListName')/items(ITEMID)/versions/{version-id}?expand=fields

That should return JSON that you can Parse to get the individual field values.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

4 REPLIES 4
Pstork1
Dual Super User
Dual Super User

You could use a REST call to get the previous version of the item.

Get Previous Versions of SharePoint List Items in Flow (catapultsystems.com)

 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Going through the link it suggests to use a Compose to get the previous version number but it doesn't explain how to check if the value of the two versions matches. Could you add a bit more detail on this part please.

You have to retrieve the metadata for the previous version and then compare the specific fields you want to compare.  There is no way that I know of to compare the actual records directly.  To retrieve the values in the previous version it would be the following REST call

_api/web/Lists/getbytitle('MyListName')/items(ITEMID)/versions/{version-id}?expand=fields

That should return JSON that you can Parse to get the individual field values.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Sorry I'm not quite sure how to use what you have suggested, but thank your response. I have instead decided to use a choice field to control whether or not the changes should be ignored. This works for my purposes

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Users online (3,253)