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 / Power Automate / Renaming a SharePoint ...
Power Automate
Answered

Renaming a SharePoint Folder or Document Set

(1) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi all,

 

Does anyone know of a way that a SharePoint folder and/or document set can be renamed through Flow?  There doesn't seem to be anything obvious through the SharePoint actions that are available.

 

 

Thanks!

Categories:
  • v-yamao-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

     

    We do not have a direct action can be used to rename folder and document set in SharePoint library. If you need this feature, please consider submitting a request on Flow Ideas Forum:

    https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas

     

    However, if you are familiar with Rest APIs, you could try to create a custom connector to achieve it. Please check the following for a reference:

    Update folder name using REST API

    Custom connectors in Microsoft Flow

     

     

    Best regards,

    Mabel Mao

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @v-yamao-msft  thanks for this, have posted a new idea here: https://powerusers.microsoft.com/t5/Flow-Ideas/New-SharePoint-Action-rename-file-folder-document-set/idi-p/137673#M8608

     

    In the meantime, for anyone else that needs to rename a folder or document set in Flow, as @v-yamao-msft  mentioned you need to use the SharePoint API via the "Send an HTTP request to SharePoint" action, like this:

     

    Renaming a document setRenaming a document set   

     

    In the above example, "Name" is the name of the existing document set, and "ProjectName" is the new name.  "Business Case Requests" is the name of the document library that contains the Document Set.  I can confirm the above works for Document Sets, haven't tried it on a folder yet.  

     

    Hopefully some more basic SharePoint actions get added to flow soon, it took me a while to get this right, and for information workers who wouldn't have a clue as to how to leverage the SharePoint API, basic SharePoint operations like this will be difficult for them to achieve!

  • ryan2k Profile Picture
    176 on at

    @Anonymous

    Thanks for the workaround! Hard to believe such a basic task requires the API connector... I'm trying to rename a simple Folder, but am having a hard time tweaking it just right. I've shared it here: https://powerusers.microsoft.com/t5/Using-Flows/Copy-and-Rename-a-SharePoint-Folder/m-p/167932

     

    The Properties for the Folder are a bit different than the Document Set and I feel like I've set it up as it should be, using the 'name' propery, but it doesn't seem to like that. Any thoughts?

  • FinTechPKOBP Profile Picture
    2 on at

    Hi! I have tried this solution and got the following error message "Server relative urls must start with SPWeb.ServerRelativeUrl". What I am missing?

  • JessEIeng Profile Picture
    2 on at

    @Anonymous Thanks for your post! It has helped me the most of any other along this topic. In fact, following your example allowed me to get the flow to run successfully for the first time! Woohoo!

     

    There is one exception though, It didn't actually rename the file. When I looked at my document list the file had the same name as the previous one though the last part was incremented up by 1.  Overall, I'm trying to achieve the following:

    Enter/Update/View information via PowerApps

    Create SP List item when new PA form is submitted

    Create a Word document by entering Properties into Word Template

    Convert said Word document to PDF

    Email Document as email body and attach PDF

     

    So far, I've got everything to FINALLY run successfully with the exception of not renaming my word template when the properties are updated. I managed to give the PDF the Project Name property as it's file name but am struggling with doing the same for the new word document.  

    HTTP Flow.JPG

     

    Any insights you might have to help me change the file name would be great!

  • blinduvlad Profile Picture
    4 on at

    No it doesn't work. I've banging my head for hours. No luck.

    I get: Microsoft.SharePoint.Client.InvalidClientQueryException

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I was receiving this error when attempting to rename a document set.  

    An unexpected 'PrimitiveValue' node was found when reading from the JSON reader. A 'StartObject' node was expected.
     
    Here's how I got it to work:
    Annotation 2019-04-19 054711.png
     
     
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @JessEleng

    I know this is old, did you ever figure it out?  I noticed you have a GET instead of a POST

     


    @JessEIeng wrote:

    @Anonymous Thanks for your post! It has helped me the most of any other along this topic. In fact, following your example allowed me to get the flow to run successfully for the first time! Woohoo!

     

    There is one exception though, It didn't actually rename the file. When I looked at my document list the file had the same name as the previous one though the last part was incremented up by 1.  Overall, I'm trying to achieve the following:

    Enter/Update/View information via PowerApps

    Create SP List item when new PA form is submitted

    Create a Word document by entering Properties into Word Template

    Convert said Word document to PDF

    Email Document as email body and attach PDF

     

    So far, I've got everything to FINALLY run successfully with the exception of not renaming my word template when the properties are updated. I managed to give the PDF the Project Name property as it's file name but am struggling with doing the same for the new word document.  

    HTTP Flow.JPG

     

    Any insights you might have to help me change the file name would be great!


     

     

  • andeeh1974 Profile Picture
    19 on at

    @Anonymous  @Anonymous  @blinduvlad  @JessEIeng  @FinTechPKOBP 

     

    Can I use this method to rename a folder using a list as my new file name? 

    For example, I have several hundred folders in a library.  Each folder is currently named a name, "Bugs Bunny".  I have a list with columns "FullName" = "Bugs Bunny" and "EmpID" = "12345".  I want to rename "Bugs Bunny" to the EmpID value of "12345".  

    I've messed around with this example to do this but I am not getting the results I need.  

    Any help would be greatly appreciated!!

     

    Andee

  • ques0buffet Profile Picture
    105 on at

    Old post but I recently encountered the same issue and resolved it by using the follow string for the document set path:

     

    This did not work: LibraryName/DocSet
    This DID work: /sites/ParentSite/SubSite/LibraryName/DocSet

     

    This works for folders and document sets.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 321 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 244

#3
Henil Profile Picture

Henil 102

Last 30 days Overall leaderboard