Just new to power automate (flows), could anyone take me through step by step how i create a flow, that will go into a folder and subfolders and delete all files in each that are older than 14 days please?
@annetoal how would you apply the same logic to delete folders? As the above will only delete files in folders but not the folders themselves.
Happy to help. Please mark it as a Solution.
To make it run on a schedule, substitute a Recurrence trigger for the Manual trigger.
Anne
Works perfectly. Thank you, one other quick thing on it, how do i set it to auto run every day?
From:
outputs('Get_files_(properties_only)')?['body/value']
Filter:
item()?['{IsFolder}']
is equal to false.
Apply to each:
body('Filter_array')
Condition:
items('Apply_to_each')?['Created']
is less than or equal to
subtractFromTime(utcNow(), 14, 'Day')
Delete step:
File identifier:
items('Apply_to_each')?['{Identifier}']
This ought to get you started. If it helped, please mark it as a Solution.
Anne
Michael E. Gernaey
497
Super User 2025 Season 1
David_MA
436
Super User 2025 Season 1
Riyaz_riz11
244
Super User 2025 Season 1