web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Auto delete flow is de...
Power Automate
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

 

Categories:
I have the same question (0)
  • VictorIvanidze Profile Picture
    13,073 on at

    It means your condition always returns Yes.

  • Design123 Profile Picture
    4 on at

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

  • grantjenkins Profile Picture
    11,063 Moderator on at

    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.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard