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 / Create static file str...
Power Automate
Unanswered

Create static file structure when a parent folder is created

(0) ShareShare
ReportReport
Posted on by 340

Hey guys,

 

So I have read a few posts but cant find anything that fits my particular scenario.

Our client creates a new folder in the projects folder (when a new project is started). That should then trigger a flow to create a static set of folders with some folders having additional sub-folders. The part that I'm stuck on is the sub-folder for certain folders.

 

So this would be a sample of what I'm trying to create. Create parent folder "Project A" and then the flow creates the folder set:

[
 Name: "1 Legal"
 Name: "2 Client"
	Subfolders:
		Name: "1 Samples"
		Name: "2 Invoices"
		Name: "3 Reports
 Name: "3 Design"
 Name: "4 Reports"
 Name: "5 Safety"
	Subfolders:
		Name: "1 Induction"
		Name: "2 First Aid"
		Name: "3 Training"
 Name: "6 Admin"
	Subfolders:
		Name: "1 Procedures"
		Name: "2 Employment"
		Name: "3 Templates"
 Name: "7 Handover"
 Name: "8 Maintenance"
]

This was the basic flow

da1ve_0-1657845806218.png

Step 1: Watch for a new folder and have the following trigger conditions 

  • @equals(triggerOutputs()?['body/{IsFolder}'],true)
  • @equals(triggerOutputs()?['body/{Path}'],'Shared Documents/')

Step 2: Create the folder structure array

Step 3: Compose the "Document library\Parent folder name"

  • DL = first(split(triggerOutputs()?['body/{Path}'],'/'))
  • PFN = triggerOutputs()?['body/{Name}']

Step 4: Condition: Is this a folder (true or false)

Step 5: Apply to each and create a new folder

 

The other option I was thinking of was create a document library and have the actual file structure there and then when a parent folder is created, copy the folder structure to that new parent folder

 

Source:

da1ve_1-1657846238516.png

 

Target:

da1ve_2-1657846279895.png

 

This would be the action

da1ve_3-1657846385162.png

Destination Folder: /Shared Documents/Project A (  triggerOutputs()?['body/{Name}']  )

 

The problem I'm facing here is that it wants to copy an actual folder and not just this libraries contents. So in order to get it to work I need to create a folder within "folder structure" but that then copies that folder with contents to the target rather than just the contents.

 

Hope this all makes sense, ideally i would like option 1 to work but also would like to know what I'm doing wrong with option 2

 

Thanks

Categories:

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 243 Super User 2026 Season 2

#2
David_MA Profile Picture

David_MA 211 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 190

Last 30 days Overall leaderboard