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
Hi, what is yout solution for a second document with the same name. I´m looking for an workaround to set the name to "Updated the name(2)" and "Updated the name(2)....
ReplyDeleteThanks for that, really helped me out!
ReplyDeleteThanks so much for the solution.
ReplyDelete