In this post, I will describe how you can delete SharePoint list items older than 15 days by using a Power Automate flow.

For the demo purposes I will create an Instant cloud flow.

Trigger

For my trigger, I will add the Recurrence trigger and configure it to run every day.

1st Action

The next step will be to add an Initialize variable action where the value will be the number of the days, i.e., 15.

Type into the function : addDays(utcNow(),-15,’yyyy-MM-dd’)

2nd Action – Get items

The second action will be a Get items. Select the Site Address, List Name and set the Filter Query to Created It ‘{Initialized Variable}’

3rd Action – For each

As third step, add a For each action and into the “Select An Output From Previous Steps” field, add the the body output from the Get items action.

4th Action – Delete item

The last action is the Delete item, where you select the Site Address, List Name and add into the Id field the ID value from the

After you have completed the above steps the flow will appear like the image below.

 

Share This