I'm trying to get the "File Version" property set for a file in Windows Explorer in a Flow. We have a version handling for documents and would like to have it as Metadata and process files differently in a Power Automate flow depending on version. I can not find the other data, for example "Authors" either. See screenshot with highlights at the bottom.
I've tried the Actions "Get File Metadata" and "Get File Properties" but the only version I can find is the document version in Sharepoint.
Am I trying to do something that is not possible, or have I missed some "Action" in Flow that can get me this data?
Any help will be very appreciated! Thanks in advance!
You can rename your file as a zip and extract it. In the core.xml there should be cp:version & dc:creator nodes with your values.
Below is an example how you could retrieve these docprop values:
I used these two expressions in the compose action. You can probably also use xpath, but I decided to go for the shortcut and used a substring and split function 😁
substring(split(body('Get_file_content_using_path_-_OdfB'), 'dc:creator'), 1, sub(length(split(body('Get_file_content_using_path_-_OdfB'), 'dc:creator')), 3))
substring(split(body('Get_file_content_using_path_-_OdfB'), 'cp:version'), 1, sub(length(split(body('Get_file_content_using_path_-_OdfB'), 'cp:version')), 3))
Thanks for the reply and that you took your time posting it in a very easy and understandable way!
I solved the immediate need by storing the version number in a cell in the Excel file. But this was a good workaround, will try when I get some time 🙂
I think I might have overcomplicated things 😁 Just noticed the Properties method when retrieving items via HTTP requests. Learning something new every day.
You could also use the approach below to retrieve File Properties.
In this example I added a ?$select=Version_x0020_Number to only retrieve my custom Version Number field. Remove that when you want to retrieve all fields.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Join us on June 28 for our monthly User Group leader call!
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!