cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Restore previous document version and delete current on SharePoint 2013

Is there a way to restore the previous document version and delete the current on SharePoint 2013 using the Send an HTTP Request to SharePoint node?

Any help would be appreciated!History Versions.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Anonymous
Not applicable

Re: Restore previous document version and delete current on SharePoint 2013

@abm 

I can't seem to be able to retrieve the Versions of the document.

When I insert the URL in the browser I am able to successfully obtain something.

works in the browser: https://XXXXX.sharepoint.com/xxxxxx/xxxxxx/_api/Web/GetFileByServerRelativePath(decodedurl='/xxxxxxx...

However, this is not working when running with Send an HTTP Request to SharePoint:Versions 1.png

 

Versions 2.png

 

 

 

SharePoint is able to retrieve https://XXXXX.sharepoint.com/xxxxxxxx/xxxxxx/_api/Web/GetFileByServerRelativePath(decodedurl='/xxxxx...')

so the document is indeed correct and it does exist. I am sure of that.

 

This is what worked for me:

Versions 3.png

 

View solution in original post

11 REPLIES 11
Highlighted
Super User III
Super User III

Re: Restore previous document version and delete current on SharePoint 2013

Hi @Anonymous,

 

I have managed to do this via flow. There are quite a lot of steps to follow here.

 

Once I updated all information I will let you know soon.

 

Thanks

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Highlighted
Super User III
Super User III

Re: Restore previous document version and delete current on SharePoint 2013

Hi @Anonymous ,

 

Please see my blog post 

 

https://mydevexperience.wordpress.com/2019/06/08/build_msflow_restoredocversion/

 

Any questions please let me know.

 

If you found this useful mark it as accepted solution.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Highlighted
Super User III
Super User III

Re: Restore previous document version and delete current on SharePoint 2013

Hi @Anonymous ,

 

Did you tried the flow steps which I suggested?

 

If you need further help please let me know.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Highlighted
Anonymous
Not applicable

Re: Restore previous document version and delete current on SharePoint 2013

Thank you for your answer @abm.

 

What did you put in the GetFolderByServerRelativePath? Was it the Folder Path? Or maybe the file name with extension?

I tried with both but it didn't work.

FolderPath.png

 

 

 

Highlighted
Anonymous
Not applicable

Re: Restore previous document version and delete current on SharePoint 2013

@abm 

I can't seem to be able to retrieve the Versions of the document.

When I insert the URL in the browser I am able to successfully obtain something.

works in the browser: https://XXXXX.sharepoint.com/xxxxxx/xxxxxx/_api/Web/GetFileByServerRelativePath(decodedurl='/xxxxxxx...

However, this is not working when running with Send an HTTP Request to SharePoint:Versions 1.png

 

Versions 2.png

 

 

 

SharePoint is able to retrieve https://XXXXX.sharepoint.com/xxxxxxxx/xxxxxx/_api/Web/GetFileByServerRelativePath(decodedurl='/xxxxx...')

so the document is indeed correct and it does exist. I am sure of that.

 

This is what worked for me:

Versions 3.png

 

View solution in original post

Highlighted
Super User III
Super User III

Re: Restore previous document version and delete current on SharePoint 2013

Hi @Anonymous ,

 

In your step Send an 'HTTP request to SharePoint7' Uri value don't need the https://xxxx.sharepoint.com/ instead you need _api/Web/..........etc

 

t.png


Please see my blog post for more details

 

https://mydevexperience.wordpress.com/2019/06/08/build_msflow_restoredocversion/

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.


Thanks

 

 

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Highlighted
Anonymous
Not applicable

Re: Restore previous document version and delete current on SharePoint 2013

@abm 

Thanks, I must have written that twice by mistake.

 

Anyways, to sum up, this did not work for me:

 _api/Web/GetFileByServerRelativePath(decodedurl='library/document')/Versions/restoreByLabel('VersionLabel')

 

This did:

 _api/web/GetFolderByServerRelativeUrl('library')/Files('document')/Versions/restoreByLabel('VersionLabel')

You could add this as an alternative option to your blog post.

Highlighted
Super User III
Super User III

Re: Restore previous document version and delete current on SharePoint 2013

Hi @Anonymous ,

 

Thanks for your update.

 

The difference is we have two different configurations.

 

I have edu is my document library and Portal Ideas is the folder name.

 

Looks like you have no specific folder names. 

 

Glad to hear that it is wokring as expected.

 

Thanks

 

Ajith



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Highlighted
Resolver I
Resolver I

Re: Restore previous document version and delete current on SharePoint 2013

Im currently working on this as well, when i run the http request the restorebylabel returns null value

 

Error2.JPG

Highlighted
Super User III
Super User III

Re: Restore previous document version and delete current on SharePoint 2013

Hi @karl_oliverio ,

 

Could you please follow this link below & check whether you could restore it manually or not.

 

https://support.office.com/en-us/article/enable-and-configure-versioning-for-a-list-or-library-1555d...

 

Let me know whether you can do the restore manually.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Highlighted
Resolver I
Resolver I

Re: Restore previous document version and delete current on SharePoint 2013

Hi @abm  - I got it now. When the document version is restored, it will create a new version on top of the current version. I was thinking the old version will just become the current published version. I already checked it and it is working as expected. Thank you!

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (7,217)