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

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Filter Sharepoint:GetI...
Power Automate
Answered

Filter Sharepoint:GetItems based on if current date falls between two dates in list

(0) ShareShare
ReportReport
Posted on by 12

Objective : Use a scheduled flow to send an email with list of all current date " banquet events".  (includes multiple day events that started before current date but end after current date)

 

Data : Sharepoint Online Event List (Banquet Event Calendar)

 

Current Issue : 

 

Filter Array Object : 

  • From Sharepoint Get Items
  • @And(greaterOrEquals(startOfDay(utcNow()), item()?['EventDate']),@lessOrEquals(startOfDay(utcNow()), items('Apply_to_each')?['EndDate']))

Obviously , that will not work.

 

Is there a way to filter all list items and return only items where the current date (startOfDay(utcNow()) falls between the Event List's EventDate and EndDate?

 

Thank you greatly for your help!

Categories:
I have the same question (0)
  • Mira Ghaly Profile Picture
    11,415 Moderator on at

    @pgc-hawkins 

    on your Get Items Filter

    Try the below:

    le less than or equal

    ge greater than or equal

     

    StartDate ge 'utcNow('yyyy-MM-dd')' and EndDate le 'utcNow('yyyy-MM-dd')' 

     

  • pgc-hawkins Profile Picture
    12 on at


    That works beautifully as long as the StartDate is the utcNow().
    The situation i come across is if the StartDate is one to two days before utcNow() and the EndDate is ge utcNow()

     

    Maybe I should throw in an OR ?


    or(

    And(

    greaterOrEquals(item()?['EventDate'],utcNow('yyyy-MM-dd)),

    lessOrEquals(item()?['EndDate'],utcNow('yyyy-MM-dd))

    )

    ,

    And(

    lessOrEquals(item()?['EventDate'],utcNow('yyyy-MM-dd)),

    greaterOrEqualsitem()?['EndDate'],utcNow('yyyy-MM-dd)

    )

    )

     

    I have the feeling I am missing some basic logic in my grey-matter.

  • Verified answer
    pgc-hawkins Profile Picture
    12 on at

    I was definitely over thinking the filter on this one!

     

    @And(

    lessOrEquals(

    item()?['EventDate']

    ,

    formatDateTime(utcNow(),'yyyy-MM-ddT00:00:00Z')

    )

    ,

    greaterOrEquals(

    item()?['EndDate']

    ,

    formatDateTime(utcNow(),'yyyy-MM-ddT23:59:00Z')

    )

    )

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 239 Super User 2026 Season 1

#2
David_MA Profile Picture

David_MA 177 Super User 2026 Season 1

#3
Kalathiya Profile Picture

Kalathiya 97 Super User 2026 Season 1

Last 30 days Overall leaderboard