Problem Statement
When we upload a document to SharePoint and have to rename it as soon as it is uploaded, there is no straightforward way to do it using the Update action.
Workaround
We can use the HTTP Action to update the FileLeafRef attribute of the file
Create the Flow
Let’s add the When a file is created trigger action to invoke the flow whenever a file is uploaded to SharePoint

We will be appending the current date to the file name as soon as it is uploaded. To do this create a variable and add append the current date to it using the expression: formatDateTime(utcNow(),’yyyy-MM-dd’)

Before we add the HTTP Action, we need to get the ListItemEntityTypeFull name which can be obtained using the below URL. Ensure to update the URL with your environment specific values
https://yoursite/_api/web/lists/getbytitle(‘List Name’)?$select=ListItemEntityTypeFullName |

Now let’s add the HTTP Action and update the Header and Body of the action as below :

Test the Implementation
Now let’s test the implementation by uploading a file with the name RevenueForMarch and see if the file name gets updated and appended with the upload date as well.

Now let’s head over to the Power Automate page and see if the flow has run

The flow was run successfully and has updated the file name in SharePoint as well :

Summary
Thus, we saw how to update the file name of a document as soon as it is uploaded to SharePoint using HTTP Action in Power Automate