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 / When a file is created...
Power Automate
Answered

When a file is created in a folder, but not subfolder

(0) ShareShare
ReportReport
Posted on by 14

I have created a flow that when a folder is created in a specific location in sharepoint, it will create a sub-folder within it. 

However, if I create another folder in the new one I have created, it triggers a loop and creates a new folder 'with the same name' in the original location with the sub-folder added.

 

How can I make the trigger only happen when a folder is created in a specific location, and not when a folder is created within a sub-folder in this specific location?

Categories:
I have the same question (3)
  • Verified answer
    grantjenkins Profile Picture
    11,063 Moderator on at

    On your trigger you can add a trigger condition to check the path to see if it's within your or not.

     

    See example below where I only want the flow to run when the file/folder being created is directly within the Clients folder.

     

    //Only trigger if the item was created at the top level of our Clients folder
    @equals(triggerOutputs()?['body/{Path}'], 'Documents/Clients/')

     

    To add Trigger conditions, on the trigger click on the three dots ... then click on Settings and Add under Trigger Conditions.

     

    grantjenkins_0-1669644267678.png

     

    In my example below, I've got two triggers. If it's in the Clients folder and only if it's a folder that was created. If you only wanted to trigger it to work with files (and not folders) then you could set that condition to false.

     

    grantjenkins_1-1669644363013.png

     

     

  • Benmcartney Profile Picture
    14 on at

    That worked! Thankyou so much

     

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

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 484

#2
Valantis Profile Picture

Valantis 477

#3
Haque Profile Picture

Haque 456

Last 30 days Overall leaderboard