Hey Guys,
I copied this flow (https://powerusers.microsoft.com/t5/Using-Flows/Automatically-delete-files-in-Document-Library-after-X-days/td-p/70009) 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?
company.sharepoint.com/shared documents/folder1/CGI
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.
Thanks.
Hello, @ScottShearer!
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.
Thank You!
-Gabriel
Microsoft Flow Community Manager
Would it matter if its the top level site.
The document library I am trying to run this on is on
https://mycompany.sharepoint.com/Shared Documents/
Which is just the main Document Library on the site.
The site my flow works on with no issues is:
https://mycompany.sharepoint.com/sites/Testsite
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.
Does MS offer support on flows at all?
I really need to get this figured out but even if I had to pay for support thats ok.
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???
Not sure what you're asking you left out a word 🙂
But does this help give any indication? This is from my run history for that flow:
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?
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.
Take a look at this solution as I believe it is very close to what you need.
If this answers your question, please mark your post as Solved.
Scott