Hi, I have a folder on Sharepoint. Inside this folder, some folders are created daily with name as date and time format like - '2020-09-21-1000 AM'. These folders have some files. I want to create a flow that runs daily and delete all folders with name 15 days or before current date. So if today is 21 Sept, 2020, any folder with name '2020-09-06 *" or less should be deleted. Kindly advise how to do this.
hi @mayankgoyal you can follow this topic to find how to dele folders
@ChristianAbata - I checked the response, not able to understand one thing, where and how will I apply the date logic to only delete folder with name 15 days or before and skip the others.
@ChristianAbata - Thanks a lot for your response, I am bit new to power automate and learning it, is there a way we can implement something like below. In our case there is a parent folder, which has n number of folder i want to delete all folders with foldername beyond 15 days. Folder name is in date time format.
Get all folders in parent folder
For each folder in folders list
If Date(folder.name) < now - 15
@mayankgoyal yes my example did what you need
see Date(folder.name) is equals to my NAME condition
In my condition I have equals to, you need to change ot for less than
The expression gives you the number
and last you need to select the folder you are going to delete
@ChristianAbata - I tried this, the challenge I am facing is with step1, I provided parent folder path in Get folder metadata using path. It doesnt return list of sub folders in parent folder. I need the list to loop on it and check name of each sub folder and then decide to delete it.