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 / Adding a prefix to a f...
Power Automate
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

Categories:
I have the same question (0)
  • efialttes Profile Picture
    14,756 on at

    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!

  • leightonmjones Profile Picture
    2 on at

    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

    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!

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

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard