Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

Adding a prefix to a filename using tagged metadata

(0) ShareShare
ReportReport
Posted on by 2

Hi,

 

My office is moving to SharePoint Online and I want to try and make as much use of the automation opportunities as possible.

I am looking for help with the following:

 

When a file is uploaded to the document library a prefix is added to the filename taking from the tagged metadata. So for instance if the file is tagged as Company "A" then the prefix "A"-FileName is added to the file i.e A-Business Case. This would also be true for Company"B" and so on.

 

Grateful for any help that can be provided

 

Thanks

  • efialttes Profile Picture
    14,756 on at
    Re: Adding a prefix to a filename using tagged metadata

    Hi!

    "would the created by show as a System Account I assume?"

    Your flow will be executed with credential from a specific user.. this same user will be the one shown in 'created by'. Some organizations define a user just for this purpose, I guess

    One more question... one problem we will face is that 'when a file is created' triggers even though metadata are not yet set. I cn think on different approaches to solve it:

    -some Flow designers decide to add a Delay action block assuming all metadata will be added in less than X minutes

    -some other decide to run a flow every night identify files created the day before and do their magic

    -some others prefer to use 'when a file is created or modified' use a conditional trigger to check needed metadata value is available, if not yet terminate the flow. So each time you add/modify a the condition will be evaluated

     

    So, according to your requirements, which of these three aproaches fits better?

    Thanx!

  • leightonmjones Profile Picture
    2 on at
    Re: Adding a prefix to a filename using tagged metadata

    Thanks for the reply @efialttes 

     

    I think the second approach would still fit my requirements  would the created by show as a System Account I assume?

     

    Do you have any examples of this flow? Apologies I am really new to all this

     

    Thanks

  • efialttes Profile Picture
    14,756 on at
    Re: Adding a prefix to a filename using tagged metadata

    Hi!

    As far as I know Power Automate cannot rename files from a Sharepoint Library. If so, a common workaround is to let Power Automate to create a copy  of the original file with the new name and replicate metadata, then delete the original file. In such case, 'Created' 'Modified' values will differ, also 'Created by' 'Modified by'.

    Does this second approach fit with your requirements? 

     

    Thiese threads can be useful starting points:

    https://powerusers.microsoft.com/t5/General-Power-Automate/Renaming-a-File-in-SharePoint-Online-using-Flow/td-p/209549

    https://powerusers.microsoft.com/t5/Building-Flows/Renaming-a-File-in-SharePoint-Online/td-p/176708

    Thanx!

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow