Deleting Folders as part of retention

Copper Contributor

I have a query about how to delete empty folders after retention policy has been applied.  Some users set up folders in document libraries.  Regardless of whether we apply retention at library or folder level, only the files within the folder will delete at the specified time but the actual (now empty) folder remains.  How can we automatically get SharePoint to delete the empty folder as well as the files with in? I've seen a solution to create a flow but that will delete any empty folder, not just the ones where files have come to the end of their retention. 

1 Reply

@bravery 

I've actually done a exact blog post about this last weekend :xd:

 

Long story short, you can trigger a flow when the end of a retention label is reached. from this you can get the folder and see it's empty.

 

I go abit more in detail here:

 

https://yourmodernworkplace.com/blog/How-to-delete-Empty-folder-after-Retention-Policy