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 / Condition: Folder in s...
Power Automate
Unanswered

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

Categories:
I have the same question (0)
  • Verified answer
    SCTdan Profile Picture
    604 on at

    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!

  • v-bacao-msft Profile Picture
    on at

    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,

  • Momo Profile Picture
    26 on at

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

  • CU07110930-0 Profile Picture
    104 on at

    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

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard