Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Condition: Folder in sharepoint is empty

(0) ShareShare
ReportReport
Posted on by 26

Hi all,

 

I'm currently making a flow, which will delete all items on a library if their modification date is older than 10 years. However I'm struggling with finding a condition, which states that the folder has to be empty in order to be deleted. Any Ideas?

Capture.PNG

  • AgainOpen Profile Picture
    102 on at
    Re: Condition: Folder in sharepoint is empty

    Hi @SCTdan thank you for this solution! i was looking for something to show me when a file is in a folder (when i am mid way through a flow) and this works perfectly.

    I am trying to add a clause thought.

    What I need is to send an email when a file is added (but to a folder that was just created during my flow, so the folder does not exists or has a name till this point - for that reason i cannot start a new flow) is there any way (other than Delay - to do something like "check till there is something in the folder and then send the email - instead of "Do Until" more like a "don't do until" is that even possible? (hope so!) thanks

  • Momo Profile Picture
    26 on at
    Re: Condition: Folder in sharepoint is empty

    It works and I learned something new. thank you very much!

  • v-bacao-msft Profile Picture
    on at
    Re: Condition: Folder in sharepoint is empty

    Hi @Momo,

     

    I think the way SCTdan provides is work for you. Please try it.

    In addition, you could also use Get files to get the items first, and then determine whether it is a folder. If so, configure the Id in the List folder action.

    Please take a try.

     

    Best Regards,

  • Verified answer
    SCTdan Profile Picture
    604 on at
    Re: Condition: Folder in sharepoint is empty

    You can use List Folder to get folder contents, or Get Files should work too.  Since that returns an array of items, you can use the length() function to determine if there are any files.

     

    Quick example-

     

    With no files in the folder-

     

    And with one file in the folder, returns False-

     

     

    Hopefully that does what you need it to!

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