Hi
Is it possible to use flow to copy a file to another document library and maintaining full metadata and version history?
If i can't maintain version history of the file can i atleast extract the version from the original file and use that number to display what version it is?
I understand while using copy i create a new file the new file then gets version 1.0 because it is a a new file. But i need the version history of the orginal file to match.
If i can't get the version history with me, can i atleast display the correct version number? Maybe get the version history number fomr using a "Send HTTP Request" and then save the version number as a variable and then use another "Send HTTP Request" Patch to get the version number into the version column of the file i copied.
I know i can get the version history of the orginal file using this flow.
https://sergeluca.wordpress.com/2018/07/31/get-the-version-of-a-sharepoint-list-item-with-flow/
But how can i patch it into the new location where the file was copied to?
Solved! Go to Solution.
Hi @JimmyWork ,
As you mentioned, if Copy File, the version information of the file will not be maintained.
You have come up with a more reasonable solution, use a Column to record the version information of the source file, and record it to the Destination File.
Please first use Send an HTTP request to SharePoint action to get the version number of the source file, and then use Update file properties action to update the specified Column.
Image reference:
Expression:
body('Send_an_HTTP_request_to_SharePoint')['d']['Odata__UIVersionString']
Please take a try.
Best Regards,
Hi @JimmyWork ,
As you mentioned, if Copy File, the version information of the file will not be maintained.
You have come up with a more reasonable solution, use a Column to record the version information of the source file, and record it to the Destination File.
Please first use Send an HTTP request to SharePoint action to get the version number of the source file, and then use Update file properties action to update the specified Column.
Image reference:
Expression:
body('Send_an_HTTP_request_to_SharePoint')['d']['Odata__UIVersionString']
Please take a try.
Best Regards,
@v-bacao-msft in my case sourcefile version option not showing in my updatefile properties action. ihave Spversion but update Spversion cant change the version of file.
I did it like this.
Use following body for JSON Scheme, then you will get the following dynamic content to pick from. MinorVersion, MajorVersion, UIVersion and so on. You can use that to update the field.
{ "type": "object", "properties": { "d": { "type": "object", "properties": { "__metadata": { "type": "object", "properties": { "id": { "type": "string" }, "uri": { "type": "string" }, "type": { "type": "string" } } }, "Author": { "type": "object", "properties": { "__deferred": { "type": "object", "properties": { "uri": { "type": "string" } } } } }, "CheckedOutByUser": { "type": "object", "properties": { "__deferred": { "type": "object", "properties": { "uri": { "type": "string" } } } } }, "EffectiveInformationRightsManagementSettings": { "type": "object", "properties": { "__deferred": { "type": "object", "properties": { "uri": { "type": "string" } } } } }, "InformationRightsManagementSettings": { "type": "object", "properties": { "__deferred": { "type": "object", "properties": { "uri": { "type": "string" } } } } }, "ListItemAllFields": { "type": "object", "properties": { "__deferred": { "type": "object", "properties": { "uri": { "type": "string" } } } } }, "LockedByUser": { "type": "object", "properties": { "__deferred": { "type": "object", "properties": { "uri": { "type": "string" } } } } }, "ModifiedBy": { "type": "object", "properties": { "__deferred": { "type": "object", "properties": { "uri": { "type": "string" } } } } }, "Properties": { "type": "object", "properties": { "__deferred": { "type": "object", "properties": { "uri": { "type": "string" } } } } }, "VersionEvents": { "type": "object", "properties": { "__deferred": { "type": "object", "properties": { "uri": { "type": "string" } } } } }, "Versions": { "type": "object", "properties": { "__deferred": { "type": "object", "properties": { "uri": { "type": "string" } } } } }, "CheckInComment": { "type": "string" }, "CheckOutType": { "type": "integer" }, "ContentTag": { "type": "string" }, "CustomizedPageStatus": { "type": "integer" }, "ETag": { "type": "string" }, "Exists": { "type": "boolean" }, "IrmEnabled": { "type": "boolean" }, "Length": { "type": "string" }, "Level": { "type": "integer" }, "LinkingUri": { "type": "string" }, "LinkingUrl": { "type": "string" }, "MajorVersion": { "type": "integer" }, "MinorVersion": { "type": "integer" }, "Name": { "type": "string" }, "ServerRelativeUrl": { "type": "string" }, "TimeCreated": { "type": "string" }, "TimeLastModified": { "type": "string" }, "Title": { "type": "string" }, "UIVersion": { "type": "integer" }, "UIVersionLabel": { "type": "string" }, "UniqueId": { "type": "string" } } } } }
@JimmyWork i want to update Vesrion Field in Sharepoint which Sharepoint gives us by default not that fields which created by users in Sharepoint document Library.
@HN I dont think you can do this. I had to create a new column and write version info to that column. I dont belive we ever can overwrite the version number without causing issues.
My setup is that if a major version is published it is copied to another location where all users can view it. For me to see what version this is i create the extra column. Versions field standard sharepoint will not show the same info.
You can save the version number to the document.
https://www.glennprince.com/blog/creating-a-version-monitoring-flow-in-sharepoint/
Thannks for respons but i want to do that i asked above. Thanks for your time
User | Count |
---|---|
91 | |
40 | |
23 | |
20 | |
16 |
User | Count |
---|---|
128 | |
48 | |
47 | |
27 | |
27 |