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 / 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

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

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

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard