cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Flow to delete document set shell when it contains zero child files/folders

Hello! 

I am currently looking for a way to build a recurring flow to look for and delete document set folders that contain zero items within. Any ideas? I have the recurrence set, but can't find an action that works.

1 REPLY 1
Highlighted
Community Support
Community Support

Re: Flow to delete document set shell when it contains zero child files/folders

Hi @lmaddock308,

 

It seems that there are some unclear places in your needs, I understand that you want to delete all empty folders in the SP Library.

But it seems that you just want to delete the folder that does not contain the item. If the folder contains an empty folder, it seems that you do not want to delete it.

A bit confused, could you provide more explanation?

Before that, I have a way to delete all folders in a SharePoint library without files. You can refer to it:

  Use Get items to get all the items in the Library, and then filter the items that are Folder by Filter array.

23PNG.PNG

    Then use the List folder to check if the body of this item is empty. If it is empty, the Folder does not contain any files. 

    Use the Delete item to delete this folder.

   Note: The red fonts in the figure are expressions that need to be filled in the Expression, not directly in the field.

        Please create a new Library for testing to avoid accidental deletion.

24.PNG

Please take a try.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
secondImage

August 2020 CYST Winners!

Check out the winners of the recent 'Can You Solve These?' community challenge!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (4,214)