cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sobenson
Advocate II
Advocate 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
Advocate II
Advocate 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
Advocate II
Advocate 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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

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.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Users online (3,677)