Hi
I created a flow to go through all versions of a sharepoint item in a document library. I can get the VersionLabel and VersionId but I'm not able to get the file content of each version. Is there a way to do that in power automate?
Below is my flow. It works except the last step to get the version file content.
Cheers Harald.
Solved! Go to Solution.
To be able to get the file content of each version, you could use (Get Request) with (Send an HTTP request to SharePoint)
Site Address: yourSiteAddress
Type: Get
Sample Uri: _api/web/getfilebyserverrelativeurl('/sites/xyz/Description.docx')/versions
You will get results that contains Urls for all versions of this file like the sample below
{
"d": {
"results": [
{
"__metadata": {
"id": "https://xyz.sharepoint.com/sites/SiteName/_api/SP.FileVersionGuid",
"uri": "https://xyz.sharepoint.com/sites/SiteName/_api/SP.FileVersionGuid",
"type": "SP.FileVersion"
},
"CreatedBy": {
"__deferred": {
"uri": "https://xyz.sharepoint.com/sites/SiteName/_api/SP.FileVersionGuid/CreatedBy"
}
},
"CheckInComment": "",
"Created": "2020-01-18T14:28:21Z",
"ID": 512,
"IsCurrentVersion": false,
"Length": "543967",
"Size": 543967,
"Url": "_vti_history/512/Shared Documents/xyz/Description.docx",
"VersionLabel": "1.0"
},
{
...
...
}
]
}
}
Try to reuse this URL ""Url": "_vti_history/512/Shared Documents/xyz/Description.docx" to download file versions
To be able to get the file content of each version, you could use (Get Request) with (Send an HTTP request to SharePoint)
Site Address: yourSiteAddress
Type: Get
Sample Uri: _api/web/getfilebyserverrelativeurl('/sites/xyz/Description.docx')/versions
You will get results that contains Urls for all versions of this file like the sample below
{
"d": {
"results": [
{
"__metadata": {
"id": "https://xyz.sharepoint.com/sites/SiteName/_api/SP.FileVersionGuid",
"uri": "https://xyz.sharepoint.com/sites/SiteName/_api/SP.FileVersionGuid",
"type": "SP.FileVersion"
},
"CreatedBy": {
"__deferred": {
"uri": "https://xyz.sharepoint.com/sites/SiteName/_api/SP.FileVersionGuid/CreatedBy"
}
},
"CheckInComment": "",
"Created": "2020-01-18T14:28:21Z",
"ID": 512,
"IsCurrentVersion": false,
"Length": "543967",
"Size": 543967,
"Url": "_vti_history/512/Shared Documents/xyz/Description.docx",
"VersionLabel": "1.0"
},
{
...
...
}
]
}
}
Try to reuse this URL ""Url": "_vti_history/512/Shared Documents/xyz/Description.docx" to download file versions
Hi,
i am able to get the URL": "_vti_history/512/Shared Documents/xyz/Description.docx" . how can i copy/move the file using power automate with that url?
Hi
You can use the action "Get file content using path" to get the file content and save it wherever you want.
Hi
Thank you for your reply. Unfortunately it doesnt work. file not found for file version history with link "_vti_history/512/Shared Documents/xyz/xxx.docx"
I've the same issue.
Anyone have a solution for this issue?
When I use the link in browser I can see the right document, but in Power Automate I have always an error " File not found".
Has someone solved this one? I have the _vti_history/512/Shared Documents/xyz/xxx.docx URL but I cannot figure out how to download the file.
User | Count |
---|---|
26 | |
13 | |
11 | |
9 | |
8 |
User | Count |
---|---|
49 | |
27 | |
23 | |
20 | |
19 |