Loading...

How to rename files in SharePoint with Power Automate

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

Power Automate flow to rename a file

  1. 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.)

  2. We then Get file properties (not needed as we already have the ID from the For selected file trigger, but if you run this after another action you will need the file properties to get the ID so that you can rename the right file).

  3. 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 ListItemEntityTypeFullName property, which we will need for the next step.

  4. 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
    • 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 ListItemEntityTypeFullName property 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 more
Luise Freese: Consultant & MVP
Luise Freese: Consultant & MVP

Recent content on Luise Freese: Consultant & MVP

Share post:

Related posts

Power Automate: Retiring the Impala connector

The Impala connector will be retired and removed from Copilot Studio, Logic Apps, Power Apps, and Power Automate between April 1-14, 2026. Exi...

1 day ago

Power Automate: Get support for normalized schema import for data ingestion

Customers with existing data pipelines or data products in data mesh mostly want to stick to normalized, efficient forms such as star schema. ...

6 days ago

Power Automate: Export object-centric process mining data to Microsoft Fabric semantic model

Publishing to Microsoft Fabric breaks down data silos and amplifies the impact of your process insights across your organization. Instead of k...

6 days ago

Power Automate: Create and visualize custom KPIs in Process Intelligence Studio

Custom KPIs put your unique business priorities at the center of process analysis. While standard metrics provide valuable baseline insights, ...

6 days ago

Power Automate: Analyze your processes in Process Intelligence Studio

Process Intelligence Studio eliminates the friction between your questions and your answers. Instead of navigating rigid dashboards or using a...

6 days ago

Power Automate: Configure Entra hybrid join for hosted machine groups

Microsoft Entra hybrid join with custom virtual networks (VNETs) and hosted machine groups lets your hosted machine group bots enroll in both ...

6 days ago

Power Automate: Enable version control for desktop flows

With version control in Power Automate for desktop, you can see what changes were made and who made them. This feature makes it easier to debu...

6 days ago

Power Automate: Use Power Platform environment variables in desktop flows

Retrieve Power Platform environment variables directly through their desktop flows without the need to pass them as inputs to the flow. A new ...

6 days ago

Power Automate: Create and edit expressions with Copilot

You can create, edit, and fix your Power Automate expressions by indicating your requirements in natural language. By using this feature to in...

6 days ago

Condition vs. Switch in Power Automate: When to Use Each

A common question I hear from newer Power Automate users is when to use Condition vs Switch in the Control connector. Control is available in ...

10 days ago
Stay up to date with latest Microsoft Dynamics 365 and Power Platform news!
* Yes, I agree to the privacy policy