cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sobenson
Helper II
Helper II

Auto Deleting Files from SP Doc Library

I am trying to delete all files from a SP library at the end of the day, basically not wanting files older than 24 hours.  I have set up this flow, but I am getting the error, "An action failed. No dependent actions succeeded." "Not Found".  Help me figure this out?

Screenshot 2021-07-23 113752.pngScreenshot 2021-07-23 113725.png

1 ACCEPTED SOLUTION

Accepted Solutions
eric-cheng
Solution Sage
Solution Sage

Hi @sobenson ,

 

For your delete step, can you try with  identifier

 

Screenshot_20210724-021308_Chrome.jpg

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

View solution in original post

5 REPLIES 5
sobenson
Helper II
Helper II

Here is the error

 

Screenshot 2021-07-23 120947.png

eric-cheng
Solution Sage
Solution Sage

Hi @sobenson ,

 

For your delete step, can you try with  identifier

 

Screenshot_20210724-021308_Chrome.jpg

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

@eric-cheng Thank you!  Such a small thing, but that was exactly it!

ScottShearer
Super User
Super User

@sobenson 

While the way you have your Flow structured and the solution that you have accepted will work, it would be a much better solution if you were to use a filter query in your Get files (properties only) action and retrieve only files that meet your criteria.  Then, you can eliminate your condition and just delete all files that have been returned.

 

That said, you don't need a Flow for this - SharePoint will do this for you:

  • Go to library settings
  • Click on Information Management policy
  • Click on Document
  • Enable Retention and add a policy that deletes files 1 day after creation

image.png

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
sobenson
Helper II
Helper II

@ScottShearer Thank you, the Retention Policy looks like an easier way of doing this.  For anyone else who reads this, I was missing the Information Management policy, and needed to turn it on in Site Settings

 

Information Management Policy Settings is missing from Content Type settings or List Settings. To enable this, follow below steps:

  • Go to Site Settings –> Site Collection Features
  • Activate Library and Folder Based Retention Feature

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (2,180)