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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / $filter in V4CalendarG...
Power Apps
Answered

$filter in V4CalendarGetItems

(0) ShareShare
ReportReport
Posted on by 13

Hi all, 

 

I'm trying to build a calendar app, and I would to see today's events. I'm trying to use the latest version, V4CalendarGetItems with the $filter option, but I always get an error message of "invalid filter clause'.

 

I've tried all ways of formatting dates I could think about and it's not working. Any idea of what's wrong?

 

Below the code. Without the $filter param it works.

ClearCollect(ccEvents,
Office365.V4CalendarGetItems(ddCalendars.Selected.id,
{'$filter' : "start gt 2020-01-22T03:30:00.000Z and end lt 2020-01-24T03:30:00.000Z"}
).value)

 

 

Thanks!

 

Rafa

Categories:
I have the same question (0)
  • v-siky-msft Profile Picture
    Microsoft Employee on at

    @RLLP 

    You have to add datetime.

    ClearCollect(ccEvents,
    Office365.V4CalendarGetItems(ddCalendars.Selected.id,
    {'$filter' : "start gt datetime'2020-01-22T03:30:00.000Z' and end lt datetime'2020-01-24T03:30:00.000Z'"}
    ).value)

    Reference: https://stackoverflow.com/questions/24489458/odata-query-filter-for-datetime-range/31277779 

    Sik

  • RLLP Profile Picture
    13 on at

    Hi @v-siky-msft 

     

    thanks for the hint. I tried it, but same results:

     

    screenshot.jpg

     

    Thanks

     

    Rafa

  • v-siky-msft Profile Picture
    Microsoft Employee on at

    @RLLP 

     

    As an alternative workaround.

    ClearCollect(ccEvents,
    Filter(Office365.V4CalendarGetItems(ddCalendars.Selected.id).value, start).value, DateTimeValue(start)> DateTimeValue("2020-01-22T03:30:00.000Z") && DateTimeValue(end)< DateTimeValue("2020-01-24T03:30:00.000Z")))

    Sik

  • Verified answer
    RLLP Profile Picture
    13 on at

    Hi

     

    I finally got the solution, after reading tones of posts and blogs.

     

    I found the "inspiration" in this topic: https://powerusers.microsoft.com/t5/Building-Flows/Outlook-quot-Get-calendar-view-of-events-quot-order-by-odata/td-p/434080

     

    And the statement looks like this: "ClearCollect(ccItems,Office365.V4CalendarGetItems(ddCalendars.Selected.id,{'$filter':"start/DateTime gt '2020-01-22T00:00:00' and end/DateTime lt '2020-01-26T00:00:00'"}).value)"

     

    Thanks for your help

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 181 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 112 Super User 2026 Season 2

Last 30 days Overall leaderboard