I copied this flow (https://powerusers.microsoft.com/t5/Using-Flows/Automatically-delete-files-in-Document-Library-after... and had it working for a document library.
However I am trying to recreate this flow again on a different site and it runs sucessfully but is not deleting anything.
Ultimately I want to to delete any files older than 2 years in age (Date Created/Added/Uploaded to Site)
I am just trying to get it to delete after 1 day to verify it works before I change it to 730 days
I am using this:
@equals(formatDateTime(item()?['Created'], 'MM/dd/yyyy'), formatDateTime(addDays(utcNow(), -1), 'MM/dd/yyyy'))
Here is how my flow is layed out currently:
Does it matter if the folder CGI which I am looking to delete the files in, is inside another folder?
Any ideas why its not deleting the files in the CGI folder? They were all created/uploaded over a week ago.
Like I mentioned I have it working no issues on my other site but this one it doesn't seem to work.
Hey Scott, no I've seen that link but that is for files on an Azure FS it looks like but in any case like I mentioned I have the same setup working on another site.
But for some reason this site its not working for and the flow runs sucessfully but doesnt delete anything.
Sorry - I missed that part of your post.....
When you look at the for each loop for a run of the Flow, does it give any indication of why the condition was not met? Is it looping the correct number of times?
bump, any one else have any ideas?
I am a site owner on both sites too.
Will this method not work if the folder im trying to delete the files from is not at top level of document library???
Would it matter if its the top level site.
The document library I am trying to run this on is on
Which is just the main Document Library on the site.
The site my flow works on with no issues is:
And then a document library under here.
The issue is the flow on the top level site shows that it runs sucessfully but its not actually deleting any files.
On the Testsite it works perfectly.
Thank you for posting a reply to a topic on the Microsoft Flow Community! It appears that the users who you have been engaging in this thread with are now awaiting your reply! Please follow-up on this thread ASAP.
Microsoft Flow Community Manager
Read the announcement for more information!
Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.
We've updated and improved the layout and uploading format of the Power Automate Cookbook!
Fill out a quick form to claim your user group badge now!
The top training and networking event across the globe for Microsoft Business Applications