cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
efialtes
Kudo Kingpin
Kudo Kingpin

Workaround to update SharePoint document metadata custom columns

Hi all

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:

https://support.office.com/en-us/article/Create-a-flow-for-a-list-or-library-in-SharePoint-Online-a9...

 

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!

 

Flow_workaround_metadata.png

 

1 ACCEPTED SOLUTION

Accepted Solutions

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

https://powerusers.microsoft.com/t5/Building-Flows/File-approval-process-in-SharePoint/m-p/4174#M224...

Sorry for the duplication 😞

View solution in original post

10 REPLIES 10

Thanks so much for that.

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

https://powerusers.microsoft.com/t5/Building-Flows/File-approval-process-in-SharePoint/m-p/4174#M224...

Sorry for the duplication 😞

Anonymous
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?

Anonymous
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.

@Anonymous

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.

 

workaround2_metadata.png

 

 

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

ashmon07
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. 

Hi,

 

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.

IronArm
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.

 

IronArm_0-1612365434121.png

 

IronArm
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".  

 

IronArm_1-1612366452410.png

 

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!    This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24  17 @Anil_g  7 @ManishSolanki  13 @eetuRobo  5 @David_MA  10 @VishnuReddy1997  5 @SpongYe  9JhonatanOB19932 (tie) @Nived_Nambiar  8 @maltie  2 (tie)   @PA-Noob  2 (tie)   @LukeMcG  2 (tie)   @tgut03  2 (tie)       Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate  @Deenuji  12@ManishSolanki 19 @Anil_g  10 @NathanAlvares24  17 @VishnuReddy1997  6 @Expiscornovus  10 @Tjan  5 @Nived_Nambiar  10 @eetuRobo  3 @SudeepGhatakNZ 8     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22   Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji11FLMike31Sayan11ManishSolanki16VishnuReddy199710creativeopinion14Akshansh-Sharma3SudeepGhatakNZ7claudiovc2CFernandes5 misc2Nived_Nambiar5 Usernametwice232rzaneti5 eetuRobo2   Anil_g2   SharonS2  

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (2,255)