Microsoft Flow team has already planned this feature (please see https://powerusers.microsoft.com/t5/Flow-Ideas/Update-SharePoint-document-metadata/idc-p/44422#M2713 ). In the meanwhile, I followed @JRitmeijer recommendations at https://powerusers.microsoft.com/t5/Flow-Ideas/SharePoint-File-triggers-need-to-return-numerical-ID/... to implement a temporary workaround to update custom columns:
The workaround if based on the fact you can create Flows from a SP Library, as explained here:
So first, I select a library's document, then tap on "Create a Flow", and select the template "Request manager approval for the selected file". Such flow includes:
-a request Trigger providing "FileName" and ID as outputs.
-a SP "Get Item" bringing as default input the SP List Name, and "Folder path" as one of the outputs.
After these two steps I add SP "Get File Metadata using path" in order to get the File Content.
Finally, after completing all the calculation needed, I add a SP "Update item" action block. I get the SP List Name from the input default values included in the original template "Get Item". Once I add them, the metadata columns are displayed as inputs in the new action block.
Hope this helps!
Solved! Go to Solution.
Thank you very much for your time, let me show you the full story
I need to get email attachment, together with email address and for example body(simply any custom parameter), to a SharePoint library.
So I have created library like this:
I am able to get attachmets, but I am not able to use custom metadata to store the rest of the informations...
Ideally this should be stored in list item as an attachments but I have found it absolutly impossible to use list attachments...
So what I have did:
1) New email recieved - save attachmets to library
2) Get a metadata of this new file
3) Update/Save rest of the informations about the email to file metadate
See screenshots below(sorry for czech language, I have switched language but some parts are still in czech...):
So I am getting metadata from file I have stored from email importer, but not a custom ones as you can see.
And then in update file step, I have only file content field to be updated...
So I thought that you are updating list item, thats why you cant see more than me on your last screenshot, am I correct?
Its a little bit different scenario but I have tried to apply similiar logic as you.
Please note the workaround I originally described is only valid when you create the Flow from the Sharepoint Document Library and invoke it manually from there. In such circumstances, the trigger includes both the List Name, the Item ID and the FileName. So, we get item related info, and also file related info.
The scenario you describe seems different, since the execution trigger differs. Then you work with Create File, so you do not get any clue of either List Name or Item ID. As far as I know, you currently cannot manipulate Document Library custom metadata unless you get List related info.
Let's hope Microsoft Flow team will fix such limitations, in the meanwhile and since it looks like you need to have the whole process executed automatically without manual intervention, I would suggest you a different approach:
1. Obtain the List Name by creating a Flow as I did from the Document Library. Copy it, you can then discard this Flow.
2. Get back to you original Flow, after Create File add a SP Get Items action block with an ODATA Order By expression that allows you to identify the file in the list. In the following screenshot I am ordering the column "Last Modified" in order to get the most recent item in the list. Please note this approach may not be valid if you receive several emails almost simoultaneously
3. Add a Compose action block and apply WDL expressions to transform Get Items Array output into an Item ID valid format
4. Add an SP Update item, applying ListName and Item ID as inputs. I tested it last week, and once the GUI identified the List Name, it dinamically added Custom Metadata as input fields.
If your internal procedure allows you to execute the next step manually... I would suggest to follow the workaround I described at the beginning of the thread instead.
Does anyone currently have a more efficient way to update Document Library custom metadata? Please let us know!
I'm afraid the workarounds I described above are like a shaggy dog story, but they're the only way I've found so far to achieve this
Does this work for getting the versioning check in comment? I can't see the dynamic content for getting the "check in" comment that pops up when approval is required for check in.
I have a particular challenge which I have not been able to overcome with a workflow. Previously I have used a sharepoint list which includes a document attached to each record, however this has limitations for powerapps and is not user friendly to search or find the relevant document (there are 2.316 records). I managed to write a flow which extracted the server URL for an attachment in the list but this only worked for the first record. On further reading of online blogs .etc the recommendations are the information is added to the document as metadata, because this is better for long term document management?
With this in mind, I have now set up a folder containing all the documents on a sharepoint subsite
I have created and populated a sharepoint list from an excel worksheet using the import app. This list is located in the same subsite as the folder.
The sharepoint list contains additional information (number, Boolean, text) for each of the documents contained in the document folder.
The sharepoint list contains a column with the file name of the document, therefore each record in the list is associated with a unique document.
I have added custom columns to the document folder so they match the column headers contained in the sharepoint list and made sure the column types match.
I have been trying to create a flow which will run once, manually triggered. Its purpose is to add the information contained in the sharepoint list as metadata to the documents stored in the document folder, i have been trying to use the document filename as the ID as this is the unqiue value in common to both sources.
Once the metadata is added to the documents folder, the seperate list no longer serves a purpose and can be deleted.
All future updates to the documents and their metadata is carried out through an app
I'm new to flow, and I'm pulling my hair out a bit at this, in part i have been relying on dynamic content but this does not appear to be available for all triggers. Any advice, tips, pointers solutions are greatefully received.
Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.
Continue your learning in our online communities.
Features releasing from October 2019 through March 2020
Fill out a quick form to claim your user group badge now!
Learn how to build the business apps that you need
Find out where you can attend!
Watch & learn from the Flow Community Video Gallery!