Question

Is there a way to roll back a changed item in a list due to the rejection in the approval process?

Seems an item would not roll back to its previous state if an approve reject the changes due to the approval process.

Was it helpful?

Solution

You can as long as you have Version History turned on for the list. While it is not a built-in function, you can use the Send HTTP Request to SharePoint action in Power Automate to call the Versions REST API and restore the previous version.

  • Start by using the Send HTTP Request to SharePoint action to call /_api/Web/Lists/getbytitle('NameOfTriggeredLibrary')/items(IdOfTriggeredItem)/Versions
  • Use an expression to grab the "next to last" version returned from the Versions call. Depedning on what you named the previous action, it would look something like first(skip(Send_HTTP_Request_to_Get_Versions('value'),sub(length(Send_HTTP_Request_to_Get_Versions('value')),2)))
  • Execute RestoreByLabel by using another Send HTTP Request to SharePoint action to call /_api/Web/Lists/getbytitle('NameOfTriggeredLibrary')/items(IdOfTriggeredItem)/Versions/restoreByLabel('LabelOfPreviousVersionHere')

You may even want to encapsulate all of that in a separate Flow that you can then execute from other Flows as necessary by passing in the Library Title and Item ID.

OTHER TIPS

Technically once you commit the changes in SharePoint we can't rollback it directly but through some work around we can do it.

Create another as example temp column, update this with the original column value through the workflow, so here original column value will be retained.. now when approver reject the request update the original column value through this temp column value.

All these can be done using the workflow or flow - this way we can rollback the column value.

I found that if I right click on a modified item, then click on the version history, then click on one of the modified dates, then I get the restore version option. I assume this only works when we have at lease one approval in place. I mean if the first insert is rejected, then this restore version does not work. Well it acutely should not, because there was not any previous version and deleting this new item literally takes us to the previous version of the list.

enter image description here

enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top