cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Calendar Event Filtering & Sorting

Hello strange thing is happening (maybe by design).  I want to make a small 1 pager, that shows the next 3 calendar events, 3 flagged emails, etc..  a quick daily overview.

 

I have dropped in a Gallery and set Items = Filter(Office365Outlook.CalendarGetItems("Calendar").value,Start>=Now()).  This results in 3 events, however not sorted by date/time.  I tried wrapping a Sort() function around/in it but cannot seem to get it to work.  Ideally i want to sort and show the next three events that will occur from Now().

 

Then i also want to display a Label showing human readable relative times like "Your next event is in 39 minutes".  I am trying to achieve this with something like Text = Text(DateDiff(Now(),ThisItem.Start,Minutes),"[$-en-GB]hh:mm")

 

Ps.  I used color to represent code, as the Code formatter is not working.. I click it and nothing, at all, happens..

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Calendar Event Filtering & Sorting

Hi @ajhstn ,

 

I think this cannot be achieved so far. Because according to the documentation, the function won't return the Start time column. So you cannot use it to filter or sort. 

 

If you need this, consider to submit an idea here:

https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

Regards,

Mona 

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Highlighted
Helper I
Helper I

Re: Calendar Event Filtering & Sorting

I have tried to upgrade toV2CalendarGetItems, but now receive this error. "An identifier was expected at position 9"

 

I have tried playing with the $filter a bit, both dont work, returning the same error above.

 

Office365Outlook.V2CalendarGetItems("Calendar",{'$filter': "Start gt " & Now()}).value

Office365Outlook.V2CalendarGetItems("Calendar",{'$filter': "start gt " & Text(Now()) & "end lt " & Text(DateAdd(Now(),10,Days))}).value

Highlighted
Community Support
Community Support

Re: Calendar Event Filtering & Sorting

Hi @ajhstn ,

 

I think this cannot be achieved so far. Because according to the documentation, the function won't return the Start time column. So you cannot use it to filter or sort. 

 

If you need this, consider to submit an idea here:

https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

Regards,

Mona 

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Helper I
Helper I

Re: Calendar Event Filtering & Sorting

Thank you - where in the Docs does it say that?

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (4,860)