Power Automate: Rename file in SharePoint Online

 




We often get to change the name of the file, so in this article, I will explain how to rename the file in SharePoint Online using Microsoft Power Automate.


Below is the file which I will be renaming.





Step 1: Get the file properties

We only need to have the SharePoint item id, for which we want to rename the file

Step 2: Update the File Name

Add the "Send an HTTP request to SharePoint" connector, and update the following properties
  • Method: POST
  • Uri: _api/web/lists/GetByTitle('<LIBRARY TITLE>')/items(<ITEM ID>)/ValidateUpdateListItem
  • Body:
{
    "formValues":[
        {
            "FieldName": "FileLeafRef",
            "FieldValue": "<New File Name>"
        }
    ]
}



Execute the flow, and the file will be renamed





Happy Automating..!!
#PowerAutomate #SharePointWidgets #Microsoft

Comments

Popular posts from this blog

Rename Folder using Microsoft Flow / Power Automate in a Document Library in SharePoint Online

How to check for empty for null and empty Values in Power Automate?

SharePoint Framework (SPFx) Tab Control (react)