← Al Davies, 250 High Street

How to rename a file in SharePoint with Power Automate

Power Automate has no "Rename file" action for SharePoint libraries. The fix is one "Send an HTTP request to SharePoint" step that sets the FileLeafRef field to the new name, including the file extension.

Why is there no Rename file action for SharePoint?

The SharePoint connector reference on Microsoft Learn lists no Rename file action. Its "Update file properties" action "updates the properties stored in columns", and the file name is not one of those columns, so it cannot rename the file either.

SharePoint stores a file name in a field called FileLeafRef. If you write a new value to that field, SharePoint renames the file.

How do you rename a file with an HTTP request?

  1. Start a new cloud flow at make.powerautomate.com. Choose a trigger such as "For a selected file" or "When a file is created (properties only)".
  2. Add the SharePoint action "Send an HTTP request to SharePoint".
  3. In Site Address, pick the site that holds the library.
  4. Set Method to POST.
  5. Set Uri to _api/web/lists/getbytitle('Documents')/items(ID)/validateUpdateListItem. Replace Documents with your library name. Replace ID with the item ID from the trigger.
  6. Add the header Content-Type with the value application/json;odata=verbose.
  7. In Body, send: {"formValues":[{"FieldName":"FileLeafRef","FieldValue":"NewName.docx"}]}
  8. Save, then try it on a single throwaway file and confirm the new name shows in the library.

Do you include the file extension in the new name?

Yes. FileLeafRef holds the full file name. If you send "Budget" and not "Budget.xlsx", the file loses its extension and Windows no longer knows which app opens it.

To keep the old extension, build the new name with an expression. For example, use concat to join your new text with the extension. Take the extension from the old name with substring and indexOf.

Does a rename move the file to another folder?

No. The file stays in its current folder. If you also want to change the folder, the move file guide covers the Move file action.

For more on the HTTP action itself, see the guide to Send an HTTP request to SharePoint.

Why does the rename fail?

These are the usual causes:

  1. The new name already exists in that folder. Add a timestamp or ID to make each name unique.
  2. The name has a character SharePoint blocks, such as * : < > ? / or |.
  3. Someone has the file open. See file is locked for shared use.
  4. The library name or item ID in the Uri is wrong. Check both against the trigger output.

Want help with a file-naming flow?

I am Al Davies at 250 High Street LLC. Naming rules are a common ask from small teams: one pattern, applied to every upload, with no one fixing names by hand. I build those SharePoint and Power Automate flows remotely. A tracker is $5,000 and takes 2 weeks. The first call is free, and my portfolio shows past work.

FAQ

Can Update file properties rename a file?

No. That action edits column values, and the file name is not one of the properties it changes.

Does renaming a file break links to it?

Links that use the old file name can break. Links created with the Share button usually keep working, because they point to the file ID.

Can I rename many files in one flow?

Yes. Use Get files (properties only), then an Apply to each loop with the HTTP request inside. Test on three files first.

Sources