top of page

How to restore a previous version of a Sharepoint document using Power Automate

  • Ajith Madathil
  • Jun 8, 2019
  • 1 min read

Updated: Apr 1, 2020






A SharePoint Document Library provides a secure place to store files where you and your co-workers can find them easily; work on them together and access them from any device at any time.



Restoring a previous version of a document using Sharepoint


First lets see how we would do this in Sharepoint. We would go to the document library, select the file and then choose ‘Version history’.



Then we would select the correct version to restore to and select Restore. Easy.



Now, how can we do this using only Power Automate?


First, we will use the Sharepoint API to grab a list of the versions of the document.



In this URL, ‘edu’ is my SharePoint site, ‘Portal Ideas’ is the library name and 'tips.txt' is my document.


We use an HTTP request to call this URL.



And then we will use a Parse JSON action to unpack the results.


The easiest way to get the property name that we require is to execute the flow step (Send an Http Request to SharePoint), look at the run history and copy the JSON in to the below step (Parse JSON).


We setup a variable Comment which is taken from the VersionLabel property in the JSON.



Now, to actually restore the document to a previous version we will use SharePoint API again. This time we are calling this URL:





Hope this was useful.

Recent Posts

See All
The Compose action

Microsoft Power Automate (aka Microsoft Flow) provides lots of action steps out of the box. My favourite one is Compose. What does it do?...

 
 
 

2 Comments


Jennifer Walsh
Jennifer Walsh
Jul 20, 2021

where's the json to copy from?

Like

johncolvin11
May 14, 2021

What if I need to restore an item, as opposed to a document? How is the http syntax different?

Like
Blog Categories
 

Beginner

Intermediate

 

Advanced

Power Automate Essentials

How can I help you?

I am happy to help at any time.  You can contact me via the official PowerAutomate community forum.  Tag me (@abm) on any post you make there if you would like to me take a look at it.

I am always available for both corporate training or 1-2-1 training for individuals. 

© 2023 by Walkaway. Proudly created with Wix.com

  • Twitter Black Round
bottom of page