cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

$filter in V4CalendarGetItems

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

1 ACCEPTED SOLUTION

Accepted Solutions

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-ord...

 

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

View solution in original post

4 REPLIES 4
Community Support
Community Support

@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

Hi @v-siky-msft 

 

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

 

screenshot.jpg

 

Thanks

 

Rafa

@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

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-ord...

 

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

View solution in original post

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (46,784)