How to rename files in SharePoint with Power Automate
the issue
Although SharePoint and Power Automate are heavily interwoven, there is no “rename file” action in Power Automate - if the file lives in a SharePoint library. Out of the box that is only possible for files living in OneDrive.
I recently saw a cry for help on twitter and decided to share here how my solution looks like.
In order to change a filename, we will need to use SharePoint REST API, which is accessible to us in Power Automate via the Send an HTTP request to SharePoint action.
the Power Automate flow

-
To make things easy, we start with a For selected file trigger. (In a real-world scenario, you’d typically rename a file after something else has happened.)
-
We then Get file properties (not needed as we already have the
IDfrom the For selected file trigger, but if you run this after another action you will need the file properties to get theIDso that you can rename the right file). -
We now need to use the Send an HTTP request to SharePoint action:
- Site Adress: choose from Dropdown
- Method:
Get - Uri:
_api/lists/getbytitle('<DisplayName of your Library goes here>')
This will re turn the
ListItemEntityTypeFullNameproperty, which we will need for the next step. -
As a last step, use another Send an HTTP request to SharePoint action:
- Site Adress: choose from Dropdown
- Method:
Post - Uri:
_api/lists/GetByTitle('<DisplayName of your Library goes here>')/Items(@{outputs('Get_file_properties')?['body/ID']}) - Headers:
- Content-type:
application/json - IF-MATCH:
* - X-HTTP-METHOD:
PATCH
- Content-type:
- Body:
{'__metadata':
{'type':'@{outputs('Send_an_HTTP_request_to_SharePoint_to_get_type')?['body']?['d']?['ListItemEntityTypeFullName']}'},
'FileLeafRef':'<your new filename goes here>'}
For the type, we are selecting the
ListItemEntityTypeFullNameproperty from the output of the previous action. You could also use Parse JSON action to obtain that value.
Conclusion
Once again, the Send an HTTP request to SharePoint action in Power Automate is a lifesaver for everything that doesn’t work with the built-in actions. Also, no additional license than your Microsoft 365 license is required to use it.
Resources
To learn more about SharePoint REST, use these resources:
Feedback & what’s next?
I’d love to know what are your renaming-scenarios and also what you use the Send an HTTP request to SharePoint action for! Let me know on twitter. If you found this blog post useful, please also subscribe to my newsletter - news coming about every 2 months, I promise to not spam you!
Published on:
Learn moreRelated posts
You are holding GitHub Copilot Wrong!
Part 0 showed why constant prompting, re-prompting, and steering GitHub Copilot feels fragile. Not because Copilot is unreliable, but because ...
You are holding GitHub Copilot Wrong!
Most developers think that one can’t really use GitHub Copilot wrong. There is a chat interface that lets you also choose a model, so th...
Building a Multi-Hierarchy Ticket Classification System (Because Keywords Aren't Enough)
Look, I love a good keyword-based system as much as the next developer. They’re fast, predictable, and when your user says “VPN,&r...
Secretless cross-tenant dataverse access
Client secrets are like hiding your house key under the mat; easy to grab and impossible to audit. Certificates are just slightly better, beca...
How Azure CLI handles your tokens and what you might be ignoring
Running az login feels like magic. A browser pops up, you pick an account, and from then on, everything just works. No more passwords, no more...
How Dev Proxy teaches you to make your apps more resilient
I added Microsoft Dev Proxy to my Mermaid → Dataverse converter, because I wanted to test how it handled rate limits and API errors. What I go...
Building Azure functions that never store secrets — ever
What if your function could hit Microsoft Graph with no client secrets, no certs, and no Key Vault entries? That is exactly what a Managed id...
Introducing Mermaid to Dataverse Converter
Why diagrams matter (and why they usually fail us) Entity-Relationship Diagrams (ERDs) are the universal shorthand for talking about data mode...
It’s OK to be seen trying
It’s OK to be seen trying Somewhere along the way, we started believing that you’re only allowed to speak after you’ve figured everything out....
Stuck in pilot - Part 1: no foundations, no future
“We just need to test the AI. We’ll figure out the data later.” That sentence has quietly killed more AI pilots than any model failure ever ...