cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RobJinx
New Member

Flow that detects when a new folder is made in /Shared Documents/ and creates 3 new folders inside

Hello,

 

I am trying to make a flow that can detect when a user puts a new folder into the root document library then automatically creates 3 pre-named folders inside that newly created parent folder. Example: if I created /Shared Document/Test then /Shared Documents/Test/Drawings and /Shared Documents/Test/Install will also be made and set with unique permissions.

 

The problem I am facing currently is the trigger “When a file is created (Properties Only)” triggers for every single folder created, even in sub folders. Therefore, the nested Install and Drawings folder end up with another set of Install and Drawings folders inside, then that just goes endlessly. I need to figure out how to make “When a file is created (Properties Only)" act on folders created inside the root document library only and completely ignore sub folders other than the creation of the 3 new ones and adding permissions.

 

Here are screenshots of my flow currently:

Flow.png

1 ACCEPTED SOLUTION

Accepted Solutions
v-LilyW-msft
Community Support
Community Support

Hi @RobJinx 

Do you want to trigger the Flow only when a new folder is created in Shared Documents(does not contain subfolders)?

Please take a try to set up trigger condition as below.

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

vLilyWmsft_0-1637909464282.png

vLilyWmsft_5-1637910153051.png

vLilyWmsft_1-1637909518232.png

Save and test the flow.

When a new folder is created in Documents library.

vLilyWmsft_2-1637909814293.png

Flow will be triggerd once and create two subfolders in AAATest folder.

vLilyWmsft_3-1637909885273.png

vLilyWmsft_4-1637910065297.png

Hope the content above may help you.

Best Regards

If my solution helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-LilyW-msft
Community Support
Community Support

Hi @RobJinx 

Do you want to trigger the Flow only when a new folder is created in Shared Documents(does not contain subfolders)?

Please take a try to set up trigger condition as below.

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

vLilyWmsft_0-1637909464282.png

vLilyWmsft_5-1637910153051.png

vLilyWmsft_1-1637909518232.png

Save and test the flow.

When a new folder is created in Documents library.

vLilyWmsft_2-1637909814293.png

Flow will be triggerd once and create two subfolders in AAATest folder.

vLilyWmsft_3-1637909885273.png

vLilyWmsft_4-1637910065297.png

Hope the content above may help you.

Best Regards

If my solution helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (1,268)