Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

delete SharePoint list item based on date in list field

(0) ShareShare
ReportReport
Posted on by

List has column = "Start time" (Type = Date and Time) - format = date only

 

using the template
"Delete SharePoint list items on a recurring basis based on a condition"

 

set recurrence to daily
pointed get items at list

 

What do I put in "Condition" to trigger the delete where Now()-21 > "Start time" ?

 

I tried:

@greater(utcNow('yyyyMMdd'), formatDateTime(adddays(items('Apply_to_each')?['Start_x0020_time']), 21), 'yyyyMMdd')

 

Many thanks

David (Nobby) Barnes

  • ganno054 Profile Picture
    2 on at
    Re: delete SharePoint list item based on date in list field

    I'm having a similar issue. 

     

    I have a list for tracking staff absences. There are two separate date fields included, Date out and Date returning. I want the flow to delete any list item that has a date returning in the past. 

    I have tried the above solution and formulas without success. 

     

    First part (from what I can tell) is correct, although the get items step might need a filter query for the column? 

    ganno054_0-1712853282215.png

    Here is the apply to each:

    ganno054_2-1712853435403.png

    Using the functions as above and the test fails every time. Any help is appreciated! 

     

     

     

  • Verified answer
    v-bofeng-msft Profile Picture
    on at
    Re: delete SharePoint list item based on date in list field

    Hi  @DavidBarnes :

    Firstly, I guess you may have quoted the wrong field name (['Start_x0020_time']), I suggest you check the return value of ‘Get Items’ first.

    Secondly, I’ve made a test for your reference:

    1\My SP list

    v-bofeng-msft_0-1605505737190.jpeg

     

    2\My flow

    v-bofeng-msft_1-1605505737191.png

     

    Formula1: 

    utcNow()

    Formula2: 

    adddays(items('Apply_to_each')?['Starttime'],21)

    3\The Result

    v-bofeng-msft_2-1605505737191.jpeg

     

    Best Regards,

    Bof

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1