web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Flow to automatically ...
Power Automate
Unanswered

Flow to automatically tag files in sharepoint with managed metadata based on folder location

(0) ShareShare
ReportReport
Posted on by

Hi, 

I have a Sharepoint Document Library that has the following:

  • Custom Columns that are linked to Managed Metadata based on a term store, all columns allow multiple selections:
    • Subject
    • Document Type
    • Internal Counterparty
    • External Counterparty
  • 4 Folders:
    • General
    • Admin
    • Compliance
    • Regulation
  • The 4 folder names above are contained in the term store under subject

I am trying to create a flow that does the following:

  • On file creation or modification
  • Checks that the subject column, contains the relevant tag for the folder it is in, for example if the file is in Admin, one of the tags in the subject column should be 'Admin'
  • If it doesn't have that tag then auto tag it based on the folder name

My current flow is:

When item created or modified (properties) [Sharepoint]

Get file properties [Sharepoint]

Initialise Variables [Variable] - one for each Column

Append to Arrays [Variable] - takes column current values and appends to each variable

Update file properties [Sharepoint] - updates each column with the array variable

 

I have got close in creating this but the issue I have is as follows:

  • If I am not updating other columns do I need to create variables for each (all columns are required columns) as it seemed to require entries in the update file properties for each required column, even if not being updated.
  • How do I get it to use the folder name as the tag ie for example 'admin', I have seen in folder path property it brings the root folder as well ie 'Shared Documents/Admin/'
  • How do I then build a condition that checks if it already contains the tag as there could be multiple tags? (otherwise could get stuck in a loop)
  • The fact subject is based on managed metadata that can have multiple entries seems to be an issue, as the relevant tag seems to need to be appended as an array with a code for example:
    • This seems to work as a code, but if I am using the folder name, how would it know the code relevant to the term store item. Eg in example the bold bit below..
      {
      "Value": "Admin|2c0225f2-0c21-413a-b8c7-d589c59a5599"

 

Hope this makes sense?

Cheers

J

Categories:
I have the same question (0)
  • jamesp24 Profile Picture
    on at

    Any ideas on the above? Even if anyone can help with individual elements?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard