Introduction
In SharePoint Online, renaming a folder in a Document Library via Power Automate can be done using an HTTP request to interact with the SharePoint REST API. This approach is especially useful when you want to automate folder management tasks.
Renaming a folder in a SharePoint Online Document Library using Power Automate can be achieved with HTTP requests, as there’s no direct "Rename Folder" action in Power Automate.
Let's see step by step solution for this.
Step 1. Create a new flow with the manual trigger. https://make.powerautomate.com/
Step 2. Add the action "Get files (properties only)". Add Include Nested Items as Yes and Filter Query as "FSObjType eq 1"
Step 3. As soon as you add the compose to take the title of items, which we get it the last action, Apply to each will be added automatically.
We will add a "Compose" action to get the Title of each item.
Step 4. Add the "Send an HTTP request to SharePoint" action. Replace the Site value, the Full path of the folder, and the New folder name you want to give the folders.
I have taken the name as the combination of "Title_ID" so that we can keep unique names for each folder.
- Site Address: <Address to your site>
- Body: {"Title": "<NEW FOLDER NAME>","FileLeafRef": "<NEW FOLDER NAME>"}
Step 5. Manually run the slow. After a successful run, let's see the SharePoint Library folder's look.
Before the flow run, the Folders are in my SharePoint Library like the below image.
After a successful flow run, My folders are renamed.
Conclusion
Renaming folders in a SharePoint Document Library with Power Automate requires a workaround using the SharePoint REST API, but with the HTTP action, it’s straightforward and highly customizable.
This method lets you automate folder naming based on changing requirements, metadata, or other input, improving organization and workflow efficiency in SharePoint.