Showing results for 
Search instead for 
Did you mean: 
Kudo Kingpin
Kudo Kingpin

Workaround to update SharePoint document metadata custom columns

Hi all

Microsoft Flow team has already planned this feature (please see ). In the meanwhile, I followed @JRitmeijer recommendations at 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!





Accepted Solutions

Oops! It seems @merwan already described this workaround some days ago

Sorry for the duplication 😞

View solution in original post

Advocate I
Advocate I

Thanks so much for that.

Oops! It seems @merwan already described this workaround some days ago

Sorry for the duplication 😞

View solution in original post

Not applicable

I am trying to replicate this thing for document library but without any success...

Does it works only for a lists?

@Anonymous The screenshots I posted are from a Document Library related Flow. In which step you are struggling to replicate this workaround?

Not applicable

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:

2017-07-13 18_25_50-folder test - Email importer - All Documents.png


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...):

2017-07-14 09_26_31-Manage your flows _ Microsoft Flow2.png2017-07-14 09_27_32-Manage your flows _ Microsoft Flow3.png2017-07-14 09_25_04-Manage your flows _ Microsoft Flow.png


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

Frequent Visitor

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.

Regular Visitor

Don't think this works in 2021.  And why the heck would you rename "Update Item" to "Update File"?  That will just confuse people.




Regular Visitor

I don't think the suggested method above is still valid in 2021.  But, I was able to update Sharepoint metadata using "Update File Properties".  




Helpful resources

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,206)