web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / delete SharePoint list...
Power Automate
Unanswered

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

Categories:
I have the same question (0)
  • Verified answer
    v-bofeng-msft Profile Picture
    on at

    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

  • ganno054 Profile Picture
    2 on at

    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! 

     

     

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard