Skip to main content

Hi,

I’ve been trying to setup an automation that locates and deletes files in a Sharepoint document library (folder) older than three days and deletes them.  Thought this was going to be a simple automation to create but it has proved pretty difficult.  I understand creating a filter for the older than three days criteria but cannot figure out how to delete them.  Anyone have any pointers?  It seems like I may have to go the API route...just not sure.  Thank you!

Hi and welcome to the Community, ​@cbs01🎉

I just checked and there aren’t any “Delete File” actions available for the Microsoft Sharepoint app. We do have a feature request for a “Delete File” action to be added though, so I went ahead and added your vote for it. We can’t make any guarantees on if/when it will be added, but you’ll definitely get and email notification from us if it is.

In terms of a workaround I think you’re right and you’d need to look at going down the API route. The Microsoft Sharepoint app has an API Request action you could potentially use delete the file. They’ve got an example showing it’s possible to make a request to their API that would delete a file here: Working with files by using REST

ce0053d512449c505f5ccf9b5e1818b5.png

It’s more advanced than Sharepoint’s other actions but we’ve got a Set up an API request action that you might find useful. 

If you do give that a try and run into any trouble just let us know—always happy to lend a hand! 🙂


Reply