cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MathiasJ
Level: Powered On

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
Community Support Team
Community Support Team

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.
MathiasJ
Level: Powered On

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

Community Support Team
Community Support Team

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

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.
MathiasJ
Level: Powered On

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

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 213 members 3,224 guests
Please welcome our newest community members: