web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / When a file is created...
Power Automate
Unanswered

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard