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

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Add a prefix to all fi...
Power Automate
Unanswered

Add a prefix to all files and folders when a document library is used as a template

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have a set of files and folders that I have created a document library for. We use the same document library for many clients and want to set a prefix to the specific client. 

 

For example we have the folder Year, Client Name, Project. Then we have a series of files and folders in the main folder. Each file and folder should be prefixed with the main folder name. For example the invoice file should be year client name project invoice for example. 

 

How would I accomplish this when I create a new library using the create a document library from existing library?

Categories:
I have the same question (0)
  • Gdarmon Outlook Profile Picture
    372 on at

    Hi,

     

    To add a prefix to all files and folders when a document library is used as a template, you can use the Get Files (Properties only) action to retrieve a list of all files in the library and then use the Apply to each action to iterate over each file and folder. You can then use the Update file properties action to add the prefix to the file or folder name.

    Here are the steps to accomplish this:

    1. Add the Get Files (Properties only) action to your flow.
    2. In the Site Address field, specify the URL of the SharePoint site that contains the document library.
    3. In the Library Name field, specify the name of the document library.
    4. In the Filter Query field, specify the filter query to retrieve the files and folders you want to update.
    5. Add the Apply to each action to your flow and select the output of the Get Files (Properties only) action as the input.
    6. Add the Update file properties action to your flow and specify the following:
      • In the Site Address field, specify the URL of the SharePoint site that contains the document library.
      • In the Library Name field, specify the name of the document library.
      • In the File Identifier field, specify the ID of the file or folder you want to update.
      • In the File Name field, specify the new name of the file or folder with the prefix added.

    Once you have completed these steps, the files and folders in the document library will have the specified prefix added to their names.

     

    Br,

    Gill

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
trice602 Profile Picture

trice602 237 Super User 2026 Season 1

#2
David_MA Profile Picture

David_MA 173 Super User 2026 Season 1

#3
Kalathiya Profile Picture

Kalathiya 95 Super User 2026 Season 1

Last 30 days Overall leaderboard