Skip to main content
Community site session details

Community site session details

Session Id : Mhv5mrhLvvzhe9zZ9C1Wn+
Power Automate - Building Flows
Unanswered

Exclude subfolder in "find file in folder"

Like (0) ShareShare
ReportReport
Posted on 20 May 2019 06:07:46 by 4

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?

  • RyanRhode Profile Picture
    2 on 19 Jul 2021 at 17:32:58
    Re: Exclude subfolder in "find file in folder"

    Hello - I am trying to achieve the same using Power Bi - anyone have helpful tactics to ommit certain subfolders?
    Current function is simply ' Source = Folder.Files("file location")

     

    I am trying to ommit specific sub folders within those parent files.

  • RichardF Profile Picture
    2 on 28 Jan 2021 at 08:46:58
    Re: Exclude subfolder in "find file in folder"

    Hi Barry, I know this is an old post but just wanted to say this worked perfectly for me when I had the same issue today, so many thanks đź‘Ť

     

    cheers

     

    Richard

  • MathiasJ Profile Picture
    4 on 30 May 2019 at 19:42:14
    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.

  • v-bacao-msft Profile Picture
    on 29 May 2019 at 10:12:39
    Re: Exclude subfolder in "find file in folder"

    Hi @MathiasJ ,

     

    Any update?

     

    Best Regards,

  • v-bacao-msft Profile Picture
    on 21 May 2019 at 06:25:53
    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,

  • MathiasJ Profile Picture
    4 on 20 May 2019 at 13:08:26
    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

  • v-bacao-msft Profile Picture
    on 20 May 2019 at 06:44:46
    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,

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2

Loading complete