Forum Discussion
Oliver Kiesslich
Nov 02, 2016Copper Contributor
Getting the Version number of a SharePoint document with Flow
Hi Everyone, recently I tried to setup a flow that reacts on a file change and reads the version of a document. I would like to check if this is a major version copy it to another library. Now I have...
Glenn Prince
Sep 26, 2018Copper Contributor
Heya, I know this is a bit of an old post but I had a similar experience while I was trying to mock up a prototype for integration between SharePoint and a record keeping system. To get around it you can send a HTTP request to the SharePoint API with the file identifier to retrieve the list of versions, get the latest version and make a decision on that. If your still interested you can find a full walk through on my blog here: Creating a Version Monitoring Flow in SharePoint
Cheers, Glenn.
Kushan Lahiru Perera
Feb 08, 2019Brass Contributor
Hello,
Your blog post is really awesome and interesting.
I would suggest to refer below endpoint of SharePoint where you could reduce the number of steps.
GET: Minor Version
/web/getfilebyserverrelativeurl('/Shared Documents/filename.docx')/MinorVersion
GET: Major Version
/web/getfilebyserverrelativeurl('/Shared Documents/filename.docx')/MajorVersion
If you still need both Major and Minor version numbers, I may go with your way since multiple HTTP requests will reduce the performance of workflow.
Need to read more?
Find below reference from Microsoft MSDN
https://msdn.microsoft.com/en-us/library/office/dn450841.aspx
Kushan Perera | Microsoft MVP
Web: kushanperera.com
Blog: blog.kushanperera.com
- Glenn PrinceFeb 08, 2019Copper Contributor
Hi,
Thanks for the feedback. When I was originally looking into this those endpoints didn't exist. For what I am using it for it is more useful to get both components of the version number but I will have to update the article to include some notes about those endpoints.
Glenn