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

Exclude subfolder in "find file in folder"

Hi!

I have a flow, which I want to schedule every 20th each month.

This flow should check if there are any files in a specific folder on my OneDrive, BUT exclude subfolders and files in there.

If there are any files in that exact folder, attach those files in an email and send. 

My issue is that I cant figure out how to ignore the subfolder.

 

Any ideas?

5 REPLIES 5
Highlighted
Community Support
Community Support

Re: Exclude subfolder in "find file in folder"

Hi @MathiasJ ,

 

You could use Is folder? to exclude subfolders and files inside it in the specified folder.

 

Image reference:

12.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.
Highlighted
New Member

Re: Exclude subfolder in "find file in folder"

Unfortunately, the search is still looping through the files in that subfolder. I am only interested in files in the parent folder

Highlighted
Community Support
Community Support

Re: Exclude subfolder in "find file in folder"

Hi @MathiasJ ,

 

Below is my test result. In Apply to each, only the files and subfolders in the specified folder are traversed, the files in the subfolders are not included.

And I used Condition to exclude the subfolders, so I can only get the file contents of the files in the specified folder.

 

Flow configuration:

28.PNG

The specified folder in OneDrive:

29.PNG

Flow run history:

30.PNG

Only traversed 7 items, excluding subfolders, and only getting the contents of the file when Condition is true.

 

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.
Highlighted
Community Support
Community Support

Re: Exclude subfolder in "find file in folder"

Hi @MathiasJ ,

 

Any update?

 

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.
Highlighted
New Member

Re: Exclude subfolder in "find file in folder"

It didn't quite work for me, but I managed to validate on the file path that If [file path] contains [subfolder name], it will skip that file.

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Users online (7,208)