Hi everyone,
So What I want to achieve is to create a flow that automatically deletes everything in certain folders on Document Library, only if nobody touched those folders for 3 months. (meaning, if nobody uses files in certain folders for 3 montsh, I want them to be automatically removed from Sharepoint Document Library).
Help would be much appreciated!
Thank you!
HI @Giga how are you?
@Giga the suggested process for @Sundeep_Malik helped on your scenario?
If so, please, mark the post as answered or if you need more help on it please let us know 🙂
Best regards
Rodrigo Hentz
Microsoft Power Platform Support Engineer
So, I added a new file to a folder. But, its modified on date didnt change. I delete as well as modified the files inside it. But the date didnt change for the folder. Only the date changed for the folder, if I renamed the folder. So, I dont think your problem will be able to solve in power automate.
Instead you can try my 1st technique only to delete all the files which were not modified in the last 90 days. And in the identifier just pass the ID field you are getting from get files(properties only).
You can try yourself the folder thing.
I hope this helps.
Hey @Giga
So, I have come up with another technique for you. But you can only delete all the files from the folder, not the folder because there is no option to delete a folder.
First use list folder. After this use action get folder metadata and add the id you are getting from above. This will automatically create an apply to each loop. Then use a compose statement to store the modified on field.
After this use condition and add outputs of above compose and check if its less than the currentdate-90. If yes, use get files(properties only) and after that use delete file option.
But But But, read my next comment before using this.
Hi @Sundeep_Malik ,
Thank you very much for your response.
I started building the workflow based on your suggestion, but in a "Delete file/File Identifier" field, it asks me to specify a file that will be deleted. This is not what I want, what I want is to delete everything in the folder/directory that I have specified, if the uploaded content won't be used for more than 3 months.
Best regards,
Giga
Hey @Giga
You can use the Action get files(properties only).
After this use Apply to each and pass value field that you got from above.
After this use Modified field in a condition and put it less than than the date utcNow-90 days.
And if yes, just use action delete file.
Condition add days formula: addDays(utcNow(),-90)
I hope this helps.
WarrenBelz
146,658
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional