cancel
Showing results for 
Search instead for 
Did you mean: 

Modified trigger should give previous values for fields changed

When triggering a Flow on the modification of a list item then it should be possile to get the current and previous values of the fields that were changed. 

 

Status: Under Review

We are looking into this item now and we hope to use versioning as previous values will be retained by SharePoint for a finite period of time as it's configured to do so when you use versioning. For now, as a workaround, if you are familiar with the REST APIs, you could enable versioning in the list or the library and then use 'Send HTTP Request to SharePoint' to get the current and previous values of the fields that were changed. 

 

Thanks,

Chaks

Comments
Level: Powered On

Would be great if this worked for the Common Data Service, too. I currently have this need for Dynamics 365 GCC.

Level: Power Up

must have!


when will it come out?

Level: Power Up

absoluty must have. We need this function! 

Level: Powered On

We had this function in SharePoint Designer 2010.  I've been told not to use SPD 2010 but it's so much better.  I was able to update a specific field instead of the entire item and check if a field changed by simply puting in a Wait function like:  Wait for FieldA to not equal Current:FieldA.  If I understand it right, this would compare the field value in the data to the field value that was just entered.  Maybe my logic is flawed here but that's what it seemed like to me.

And what's with removing great functions everytime a new version comes out?

For now, search youtube for videos on how to use "Trigger Conditions".  It's not as good as SPD 2010, but if used correctly, it won't trigger all of your flows every time anything in the item is changed.

Here's a good video that I found on YouTube about Trigger Conditions  

I recently published a rather long blog than details a broader solution, inclusive of a flow that uses an Send a HTTP request to SharePoint to invoke a SharePoint Graph v2 API. That API in turns returns a complete list of the version history for any specific item in a List or for that matter any specific file in a Document Library. 

https://masteroffice365.com/powerapps/6/#PA_Graph_Item_Versions

Whilst this Flow only returns a list of all the versions of an item, you can by all accounts create an identical Flow to retrieve the metadata for any given version of that item or file.

 

The only between the Flow that returns a complete "summary" of the version history and the 2nd flow (or alternatively add additional steps to the Flow I've shared) is that you need to append "/{version-id}" to the Uri in the HTTP request action to return all the specific metadata information for whichever version you request.

 

Note: it doesn't return the specific metadata modified for each version, i.e. it returns the complete set of metadata fields, so you would have to include additional logic should you need to identify which specific metadata fields changed.

 

Example Uri:

_api/v2.0/sites/{site-id}/drive/items/{item-id}/versions

This will return the complete list of all the versions for either a list item or a file.

 

To retrieve the specific metadata for any version all you need to do is append the version id requested to the same Uri, by example:

_api/v2.0/sites/{site-id}/drive/items/{item-id}/versions/2.0

 

I have shared a link in that blog to download all the Flows described for the broader solution. In the blog I published details wrt how to obtain the {site-id}, {list-id} or {drive-id} and the {item-id}. alternatively just leverage the flows I've shared that do this for you...

 

For additional insight the most pertinent guidance on these APIs are detailed on the following links:

Listing versions of a ListItem
Get a ListItemVersion resource
Listing versions of a DriveItem
DriveItemVersion resource type