cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
chenjonathanc
Frequent Visitor

How to exclude subfolders when using Trigger: "When a file is created (properties only)"

I have a Sharepoint folder "1" 

Folder "1" has a folder inside it called "1a" 

I am triggering a flow through "When a file is created (properties only)"

 

I currently have a flow that triggers off of a file being dropped into Sharepoint folder "1". The flow ends in moving that file from folder "1" to "1a". This seems to trigger another instance of the flow, so it seems like Flow is counting files created in "1a" as being created in "1". 

 

How can I exclude subfolders from the trigger? I.e. I'd like to ONLY trigger flows from creation of files in "1" and not any of its subfolders. 

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
v-bacao-msft
Community Support
Community Support

 

Hi @chenjonathanc ,

 

You could set trigger conditions. Flow is triggered only when the folder path is equal to the specified folder.

Image reference:

75.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
abm
Super User
Super User

Hi @chenjonathanc 

 

The trigger is by design. What you could do is check the Folder Path property under an IF condition to avoid the set of actions after the trigger if it's from sub-folder.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
v-bacao-msft
Community Support
Community Support

 

Hi @chenjonathanc ,

 

You could set trigger conditions. Flow is triggered only when the folder path is equal to the specified folder.

Image reference:

75.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks @v-bacao-msft , this is a clean solution. 

Hello @v-bacao-msft, I know this is an older post, however, I'm trying to accomplish the very same thing with a flow.  I do not want the flow to trigger if a file is created in subfolders.
When I try to add 'trigger conditions' my Array is different than what is noted in the solution.

PeggyLang_1-1612214093592.png

 

The error upon flow execution is;

PeggyLang_2-1612214249825.png

 

Any thoughts/ideas?

2 years later, this still works. Thanks.

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (3,170)