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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Copy Existing Folders ...
Power Automate
Answered

Copy Existing Folders into New Folder

(0) ShareShare
ReportReport
Posted on by 10

Hello,

 

I'm new to Power Automate and wondering how to go about achieving the below. 

 

We have seperate teams working towards the same Project and once Live would like to pool their related Folders into a New Folder. For example once Live I want to create a New Folder in Documents > General > Live Project > "XXXXX - Project 1"

 

Within the same library there are Sub Folders in Documents > Sales > Contracts > "XXXXX - Project 1 Contracts" that I would like copied into the New Folder upon creation.

The search needs to match the New Folders first 5 values (numbers XXXXX - (Variable)) and copy any matching Sub Folders into the New Folder. 

 

Kind Regards

Categories:
I have the same question (0)
  • Gareth1 Profile Picture
    308 on at

    Hi @Ebonastix 

    In order to copy a folder you need to know the full path to the folder. One way to achieve this is to list the folders and filter the array for folders that contain the project number

     

    This can be applied to both the folders outside of the live projects and for the folder inside the Live Projects folders

    Once you have both of these you can copy the folders 

     

    Hopefully this helps

     

    Screen Shot 2020-01-02 at 10.02.49 pm.png

  • Ebonastix Profile Picture
    10 on at

    Hi Gareth,

     

    Thank you for the response. In the Path actions could you explain what you've done to have "ProjectNo" in there?

    I assume this is the referenced search number prior to manually triggering the flow, what is the formula?

     

    Kr,

  • Gareth1 Profile Picture
    308 on at
    I just had added a manual input on the Manual trigger called ProjectNo

    Are you trying to have this happen automatically when a folder is created in the Live Projects folder or is it a manual process you are running?
  • Ebonastix Profile Picture
    10 on at

    Ideally automated daily or upon creation of a folder in "Live Projects". so Documents > General > Live Projects > XXXXX Project1 has the latest copies of any folders across that library with the first 5 values "XXXXX".

  • Verified answer
    Gareth1 Profile Picture
    308 on at

    Hi @Ebonastix 

    You could use a scheduled flow to run daily, however the risk you could run into is that if someone works on files in the Live Projects version of the folder then the files could be overwritten, however if the Contracts folder outside of the Live Projects folder is the working folder then that should be ok

     

    In the example below I use the Select action to extract the project no (first 5 characters from the folder name in the Live Projects folder)

    Hopefully this helps

     

    Screen Shot 2020-01-03 at 9.19.10 am.png

     

    Screen Shot 2020-01-03 at 9.19.17 am.png

  • Ebonastix Profile Picture
    10 on at

    I'm having an issue that files related to Live Projects > 70000 - Project1 are landing in Live Projects > 70001 - Project2

  • Gareth1 Profile Picture
    308 on at
    Hi @Ebonastix
    Are you able to send through a screenshot of your flow so that I can check it out
  • Community Power Platform Member Profile Picture
    on at

    Can you explain in more details how you got the "Body" and "Path" functions in the "Apply to each 2"action?

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard