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

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
Community Support Team
Community Support Team

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

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

Community Support Team
Community Support Team

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

ajhstn
Level: Powered On

Re: Calendar Event Filtering & Sorting

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

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (11,042)