Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Auto delete flow is deleting from subfolders when marked as FALSE

(0) ShareShare
ReportReport
Posted on by 4

I'd love some help as to why my flow is deleting files in a subfolder when it is marked as NO/FALSE in the flow. Any clues? 

 

Design123_0-1674578532394.png

 

  • grantjenkins Profile Picture
    11,059 Super User 2025 Season 1 on at
    Re: Auto delete flow is deleting from subfolders when marked as FALSE

    The issue is that List files in folder returns both files and folders that are contained in that folder - so when you loop over the results, you're deleting both files and folders at the top-level which would effectively delete everything in the folders you deleted.

     

    When you use Get files and Get items in SharePoint, they also return both files/items and folders.

     

    To resolve your issue, there is a property that's also returned for each item called IsFolder which is set to true or false depending on whether it's a folder or file. You can check this property, and only delete the item if IsFolder is false.

     

    grantjenkins_0-1674612375396.png


    ----------------------------------------------------------------------
    If I've answered your question, please mark the post as Solved.
    If you like my response, please consider giving it a Thumbs Up.

  • Design123 Profile Picture
    4 on at
    Re: Auto delete flow is deleting from subfolders when marked as FALSE

    But why is it even looking in the subfolder in the first place? 

  • VictorIvanidze Profile Picture
    12,480 on at
    Re: Auto delete flow is deleting from subfolders when marked as FALSE

    It means your condition always returns Yes.

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May 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 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492