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 / Copy a folder then ren...
Power Automate
Answered

Copy a folder then rename the copied folder

(1) ShareShare
ReportReport
Posted on by 4
My team tracks projects in a List. Each time a new project gets added to that list (a new item is created), I want to be able to copy an existing SharePoint folder (that contains template project management files). I got the copy folder action to work, but I also want that copied folder to be renamed to match the project Title from the List (item that triggered the flow). I can't get the renaming action to work. A screenshot of how I have it set up is attached. 
 
 
 
 
my flow.png
Categories:
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,969 Moderator on at
     
    If I can make a suggestion
     
    I would create the folder (the new one), with the name, prior to copying the contents of the other.
     
    But here are some links that should help
     
     
     
  • Verified answer
    DJ_Jamba Profile Picture
    2,837 Moderator on at
    Your HTTP request action is very close. I don't use the new designer because it's buggy, so my example is using the classic designer.

     
    _api/web/GetFolderByServerRelativeUrl('PATH_TO_YOUR_NEW_FOLDER')/ListItemAllFields

    PATH_TO_YOUR_NEW_FOLDER must not contain site info.
    If the full path to your new folder is:
    https://mySP.sharepoint.com/sites/mysite/Shared%20Documents/2025/NewFolder
    Then PATH_TO_YOUR_NEW_FOLDER is:
     
    Shared%20Documents/2025/NewFolder
     
  • EA-03041508-0 Profile Picture
    4 on at
    Thank you! Thank you! Thank you! @DJ_Jamba. I got it to work thanks to your reply. Here's a screenshot of the working flow:
     
  • DJ_Jamba Profile Picture
    2,837 Moderator on at
    You're welcome and glad it's working!
     
    d(-_-)b
  • CU09100001-0 Profile Picture
    2 on at
    This was really helpful and got me on the way to solving my similar problem. The small difference is that I wanted to combine 2 separate column items from my list. I kept getting fails for a sanity testing period of time until I stumbled on the fact that the dynamic inputs add a "/" into the code which fails the folder rename. Using Copilot (which was not very helpful on this issue for a long time) I had to change the code to remove the "/" symbols. 
     
    This is the code - 
    concat( outputs('Get_item')?['body/ProjectNumber'], ' - ', replace( replace( replace( replace( replace( replace( replace( replace( replace( outputs('Get_item')?['body/ProjectName'], '/', '' ), '\\', '' ), ':', '' ), '*', '' ), '?', '' ), '"', '' ), '<', '' ), '>', '' ), '|', '' ) )
     
    As an absolute novice, I'm assuming there's a better way but this has worked so I'm moving on.

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 607

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard