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 / Using flow to analyse ...
Power Automate
Unanswered

Using flow to analyse document file names and apply term store metadata

(0) ShareShare
ReportReport
Posted on by

I have an O365 platform, and in one of the site collections I have a document library with files that are uploaded using a standard naming convention: <Business Unit>_<ITIL Practice>_<Document Type>_<Document Description>. Examples below:

ITSM_KM_POLICY_KnowledgeManagementPolicy.docx
ITSM_CM_PROCESS_ChangeManagementProcessTemplate.pdf
ITSM_AM_PROCESS_ManagingOrganizationalAssets.pdf
ITSM_KM_GOV_KnowledgeManagementGovernanceFramework.pdf

The library has 3 managed metadata columns:

1) Business Unit
2) ITIL Process
3) Document Type

I also have a managed term store, with the following hierarchy:

Branch 1
Parent term 1: Business Unit
Child terms 1: ITSM, ITSB, ITSA

Branch 2
Parent term 2: ITIL Practice
Child terms 2: KM, CM, AM, EM

Branch 3
Parent term 3: Document Type
Child terms 3: Policy, Process, Gov, Training

I would like to set up a flow that runs whenever a file is added or modified in the library, and which compares each part of the filename with the relevant term store branch, and where it finds a match, to apply the matched term store value in the correct metadata column. Where it doesn't find a match, it leaves the value blank.

 

Any help would really be appreciated. Let me know if you need more information.

Categories:
I have the same question (0)
  • Verified answer
    v-zhos-msft Profile Picture
    on at

    Hi @Anonymous ,

    Where does the data of (Business Unit ,ITIL Process ,Document Type) stored, in SharePoint list or excel file?

    I set the data via Compse action by myself on my side.

    Then I have made a flow for your scenario, please check it for a reference.

    The expression in the Compose is :

    split(triggerBody()?['{FilenameWithExtension}'],'_')
    The setting of Condition1~Condition3 are similar.
    The expression in the Condition 1 is : outputs('Compose')?[0]
    The expression in the Condition 2 is : outputs('Compose')?[1]
    The expression in the Condition 3 is : outputs('Compose')?[2]

    Capture7.PNGCapture8.PNGCapture9.PNG

    Best Regards,

    Community Support Team _ Zhongys

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Community Power Platform Member Profile Picture
    on at

    Thanks @v-zhos-msft, the logic of your flow makes sense to me and is actually super useful. However, the data of (Business Unit ,ITIL Process ,Document Type) is stored, not in a SharePoint list or excel file or hard-coded into the flow, but in the SharePoint term store. So I presume we'd need some sort of comparison clause here so that the flow:

    1) Breaks down the file names into outputs
    2) Searches the term store for matches to those outputs (or maybe just searches a parent term and all children, if searching over a whole term store isn't advisable)
    3) When it finds a match, applies the term store value to the file properties (rather than applying a term locally\just in text form in the file properties, which would mean that we can't take advantage of SP's platform-wide reach when it comes to term stores to do things like sset up search refiners for terms when doing platform-wide searches).
    4) When it doesn't find a match, leaving the column entry blank

  • Verified answer
    v-zhos-msft Profile Picture
    on at

    Hi @Anonymous ,

    Could you please share a screenshot of the data in your SharePoint term store.

    I am afraid there is no way to get the data (Business Unit ,ITIL Process ,Document Type)from SharePoint term store via flow currently.

    1 Add the data (Business Unit ,ITIL Process ,Document Type) in an array.

    2 Split the file name.

    3 Check whether the file name in the array.

    4 Update the file metadata.

    Best Regards,

    Community Support Team _ Zhongys

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

  • Community Power Platform Member Profile Picture
    on at

    Thanks @v-zhos-msft, much appreciated 🙂

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 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard