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

Announcements

News and Announcements icon
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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 103 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 87

#3
trice602 Profile Picture

trice602 63 Super User 2026 Season 1

Last 30 days Overall leaderboard