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 / Need to automatically ...
Power Automate
Answered

Need to automatically create sub-folders in Sharepoint when a new folder is created

(0) ShareShare
ReportReport
Posted on by 11

I found a couple of topics on this, but none are quite right for what I'm trying to do. Basically I have a folder structure that looks similar to Documents\<user created folder>\subfolder1\subfolders2-5 and then repeat for 10 total subfolders, each with 3-5 subfolders underneath them. I need this to trigger when that user created folder is created and only on that level, then the sub-folder should all be created underneath.

 

 

The issue I'm running into is I can't figure out two things:
1) How to make this trigger ONLY when a user creates a folder at that top level, not within a sub-folder

2) How I can reference that user created folder for creating the subfolder structure.

 

So far the only thing I've written is the basic condition to identify if a folder was created:

MattConnex_0-1694709042740.png

 

 

Any assistance with this would be greatly appreciated.

Categories:
I have the same question (0)
  • Verified answer
    MattConnex Profile Picture
    11 on at

    Actually, I think I have this one, I missed this post when I was searching:
    https://powerusers.microsoft.com/t5/Building-Flows/If-SharePoint-Folder-create-than-create-subfolder-in-the-created/td-p/1404087

     

    This seems to get me a good chunk of the way there. I can create the initial sub-folders now and it only triggers when a folder is created at the top level. However, I'm having trouble getting the folders deeper down the tree created. So I have for example:

    /Test

    //Test1

    //Test2

    //Test3

     

    But, I also need:

    /Test

    //Test1

    ///Test1-sub

    ///Test2-sub 

  • MattConnex Profile Picture
    11 on at

    Nevermind, I've got this. In case anyone else runs into this when you create the array you can build out multiple layers of sub-folders in the array with /

     

    So:

    "Test"

    "Test/Sub Test"
    "Test/Sub Test/Second sub"

     

    And it will do what you need.

  • DM-29041527-0 Profile Picture
    2 on at
    MattConnex, 
     
    Can you share your Power Automate flow on how you created the subfolders populate.  I have a similar project.  I am able to create the trigger to create the initial folder in Document Library.  However, not able to automatically trigger the automated subfolders.  I tried different methods and it either works for one folder, or it creates a continuous loop, or the folders are created as new folders in the Document Library not within the initial created folder.
     
    Example:  SP Doc Lib > New Folder created by end user > Automatically create Subfolders (5)

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 840

#2
Valantis Profile Picture

Valantis 661

#3
Haque Profile Picture

Haque 589

Last 30 days Overall leaderboard