Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 1oUGxlzbag5cl+0+h/WBdK
Power Automate - Building Flows
Unanswered

When folder created in SP, create in another SP with same name, copy specific folders to new folder

Like (0) ShareShare
ReportReport
Posted on 14 Nov 2024 04:17:09 by 1
I'm struggling with this big time. It's my first flow and really need help please. I think this is going to have to be two Flows, but I'm not sure and finding this quite a lot more difficult that I thought it would be.  I've tried a few of the previous posts here for help but can't find what I need.
 
I want to:
1. When a folder is created in a specific path in a SharePoint document library
2. Copy the name of that folder.
3. Create a new folder in a different SharePoint document library with the same name.
 
Then
4. When a folder is created in a specific path in a SharePoint document library
5. Copy the contents of that folder to the newly created folder (Step 3 above) in the SharePoint document library .
6. Create a Sharing link from the  newly created folder.
7. Email the Sharing link.
 
 
Example:
Source SharePoint: HR
   Source Library: Documents
   Source Folder: Pay\FY25

Destination SharePoint: Directors
   Destination Library: Documents
   Destination Folder: Pay\FY25
 
So if a folder is created in the Source called "Pay Scales", then create a new folder in the Destination also with the same name (Pay Scales) - but don't copy the data.
Then, if a folder is created in the Source "Pay Scales" folder, with a specific name (e.g. "ASO6\Grade1"), copy that folder (and all sub files/folders) to the "Pay Scales" folder in the Destination.

So I would end up with a folder (and contents of that ASO6 folder) in the destination SharePoint site that looked like this:
   Destination SharePoint: Directors
   Destination Library: Documents
   Destination Folder: Pay\FY25\Pay Scales\ASO6\Grade1

But it would'n't copy a folder called ASO6\Grade2 (or something else).

Thanks in advance.
 
 
  • abc 123 Profile Picture
    784 Super User 2025 Season 1 on 14 Nov 2024 at 21:55:00
    When folder created in SP, create in another SP with same name, copy specific folders to new folder
    The first question you need to ask yourself is, "Why do I NEED to use folders?"
    If the answer is, "Because of security", then continue. Any other answer, consider adding metadata to the document libraries and never deal with folders.
     
    The things available to you regarding Folders are:
    1. triggerOutputs()?['body/{Path}'] 
     
     
    3. If you use the Get Items action, and add this to the Filter Query, it looks at just folders:
    startswith(ContentTypeId,'0x0120')
     
    4. There's a Create New Folder Action
     
    With these thing, you can cobble together a routine that:
    a. Get the current folder
    b. Check if the destination folder exists
    c. Create new folder when needed
    d. Copy/Move the document to that new Folder
     
    If you need to do any string manipulation, use functions like substring, left, right, mid, etc.
     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,513 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,606 Most Valuable Professional

Leaderboard
Loading started