web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Copilot Studio + Share...
Copilot Studio
Answered

Copilot Studio + SharePoint: Is there a supported way to rename a file

(1) ShareShare
ReportReport
Posted on by 8
Goal
From a Copilot Studio agent, I want to rename an existing file in SharePoint (i.e., change the file’s Name / FileLeafRef) after creating or copying it.

What I’ve tried
  1. SharePoint → Move file
    1. Observed: In my environment, the action UI doesn’t expose an explicit “New file name” input. I only see conflict behavior (e.g., replace if item exists).
    2. Expectation: Move‑within‑same‑library with a new name (classic “move/rename”) capability.
  2. SharePoint → Copy file then delete original
    1. Observed: Copy actions I see don’t surface a “new file name” input either. That prevents a single‑step rename pattern (copy → new name → delete original).
    2. Note: I can capture outputs like Identifier/ItemId/UniqueId from the copy step, but there’s no place to apply the new name within the copy action itself.
  3. OneDrive for Business → Move or rename a file using path
    1. Observed: This would be a decent fallback, but my files originate in SharePoint libraries. Using the OneDrive path‑based action against SPO content is fragile (requires sync/mapped paths, path resolution, and can break on library moves). Looking for a native SharePoint solution.
  4. SharePoint → Update file properties
    1. Observed: The Name (FileLeafRef) column is not editable in this action (as expected), so it doesn’t rename the underlying item.
Why this matters
Renaming is a core step in our agent workflow: we copy a gold template and must rename the new file to a user‑provided value (e.g., report number + client name). Without a supported rename, we’re stuck with brittle path workarounds or multi‑step copy/delete patterns.

 
I have the same question (0)
  • Verified answer
    chiaraalina Profile Picture
    1,580 Super User 2026 Season 1 on at
    Hi
     
    You are using a Power Automate flow that you call form the Copilot Agent, right?
     
    You can use the Send an HTTP request to SharePoint action and use this Uri:
     
    _api/web/GetFileByServerRelativeUrl('/sites/YourSite/Shared%20Documents/Folder/OldName.docx')
    /MoveTo(newurl='/sites/YourSite/Shared%20Documents/Folder/NewName.docx',flags=1)
     
    You can build the newurl dynamically (example a user-provided name) and keep the same folder path while changing only the filename. flags=1 will overwrite if a file with the target name already exists.
    Hope that helps.
     
     
     
  • Mike@mdh Profile Picture
    8 on at
    First off - thank you @chiaraalina for the fast response! Much appreciated.
     
    Your workaround worked! So I'm ultimately unblocked. 
     
    However - I'm still perplexed that the 'rename' capability isn't available directly from Copilot Studio's Connector capabilities. That's where I was trying to invoke the rename. Your workaround totally functioned - however I lost lots of dev hours trying to get it to function within Connectors (trying SPO, querying Copilot, trying ODB, etc). 
     
    Any idea if Microsoft is going to support Rename capabilities directly within the Connector experience? Or will folks need to rely on a Power Automate Flow?
  • chiaraalina Profile Picture
    1,580 Super User 2026 Season 1 on at
     
    Not sure if I understand correctly but:  You don’t necessarily have to rely on a Power Automate flow. Copilot Studio allows you to use the SharePoint connector’s Send an HTTP request to SharePoint action directly, you can call the same MoveTo() endpoint from the agent. I still put it in a Power Automate flow because it’s easier to handle. But you can do both.
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Copilot Studio

#1
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 130 Super User 2026 Season 1

#2
Valantis Profile Picture

Valantis 123

#3
chiaraalina Profile Picture

chiaraalina 33 Super User 2026 Season 1

Last 30 days Overall leaderboard