cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
RLLP
Level: Powered On

$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
RLLP
Level: Powered On

Re: $filter in V4CalendarGetItems

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
Microsoft v-siky-msft
Microsoft

Re: $filter in V4CalendarGetItems

@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
Level: Powered On

Re: $filter in V4CalendarGetItems

Hi @v-siky-msft 

 

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

 

screenshot.jpg

 

Thanks

 

Rafa

Microsoft v-siky-msft
Microsoft

Re: $filter in V4CalendarGetItems

@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

RLLP
Level: Powered On

Re: $filter in V4CalendarGetItems

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
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,560)