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

Re: Outlook "Get calendar view of events" order by odata error

The only workaround I've thought of is basically to copy all today's and future events on a calendar into a .xls table and then flow twice a day to filter any new or modified events in the last 12 hours and either add or overwrite the corresponding row based on powerapps Id into the .xls table. From there the original flow created previously would get rows based on filtered date range and sort asc from that "master" table. Seems extreme overkill to have to copy all the events but only easy workaround. The initial master table building may max out at 250 or something so it may need to be done based every week or something until it gets them all then stay up to date by finding and copying.
jurgenschaub
Level: Powered On

Re: Outlook "Get calendar view of events" order by odata error

Haha! That's a good hack. I had to do something similar to sync a couple of calendars in a different Flow (which has probably also stopped working). I'd really rather not go through all that though. I'm a bit new to these forums - does MS actually read these and note issues, or is there some other mechanism for that?

BeeBee
Level: Powered On

Re: Outlook "Get calendar view of events" order by odata error

I am also having the same problem. My flow failed to work because this FilterQuery.

 

Even the expression 'and' is no longer recognized.

 

What the hell Microsoft is doing?

Highlighted
BeeBee
Level: Powered On

Re: Outlook "Get calendar view of events" order by odata error

Ok. I found the solution.

 

Here's the examples that will work in the filter query:

 

Start/DateTime gt '2020-01-08T00:00:00'

 

If you need to use 'utcNow':

Start/DateTime gt 'utcNow('yyyy-MM-ddT00:00:00')'

 

Hope this helps!

 

 

 

View solution in original post

jbedfordp
Level: Powered On

Re: Outlook "Get calendar view of events" order by odata error

That works in the Order By field as well, @BeeBee! Thanks!! Where did you find documentation of that syntax, though?

 

Flow successful with Start[slash]DateTime in Order By.png

 

cpolanish
Level: Powered On

Re: Outlook "Get calendar view of events" order by odata error

That did it! Thank you for figuring this out!!

jurgenschaub
Level: Powered On

Re: Outlook "Get calendar view of events" order by odata error

Fantastic, @jbedfordp! That totally worked. So many thumbs-up button clicks for you. Was this a bunch of trial and error, or did you find something online that explains this behaviour?

jbedfordp
Level: Powered On

Re: Outlook "Get calendar view of events" order by odata error

I can't claim credit for this solution at all -- all of my trial and error ended in error! 🤣

 

@BeeBee identified the syntax that works. It appears to cast the "start" field as a "DateTime" type or format? 

 

I'd love to know where this syntax comes from, though! I didn't see this in any of my searching thru ODATA or Flow or Graph API syntax manuals. Wherever this is documented undoubtedly has a bunch of other tips and tricks to offer!

jurgenschaub
Level: Powered On

Re: Outlook "Get calendar view of events" order by odata error

I see that now! Well lots of thumbs ups to @BeeBee as well. 😁

BeeBee
Level: Powered On

Re: Outlook "Get calendar view of events" order by odata error

@jbedfordp All thanks to the trial-and-error in your previous post. It's the start of my inspiration.

 

I was struggling with the Filter Query for utcNow.

 

Then I found this from github:

https://github.com/microsoftgraph/msgraph-sdk-javascript/issues/43

 

At first, I was using:

 

Start/DateTime gt 'utcNow('yyyy-mm-ddThh:mm:ss')'

 

and it gets translated to this instead:

 

Start/DateTime gt '2020-30-08T06:30:57'

 

so unless we are in different planet, clearly the calendar does not have 30 months.

 

then I change the date time format to:

 

'yyyy-MM-ddThh:mm:ss'

 

and voila!

 

Seriously, Microsoft needs to provide a better manual especially how to use OData and its syntax in Power Automate.

 

jbedfordp
Level: Powered On

Re: Outlook "Get calendar view of events" order by odata error

Hmm.... but where did the idea for the "/DateTime" syntax come from? That's the bit that I hadn't seen before, and which I think enables ordering by the "start" property. I can't tell if it's OData syntax or Graph syntax or Power Automate syntax or ...

jbedfordp
Level: Powered On

Re: Outlook "Get calendar view of events" order by odata error

Closest explanation of that I can find is that the "/DateTime" syntax implies that the "start" property has a related (or sub-?) property called "DateTime"... 

 

https://www.odata.org/documentation/odata-version-2-0/uri-conventions/

(search for "forward slash")

 

🤕

gdavenport
Level: Powered On

Re: Outlook "Get calendar view of events" order by odata error

Brilliant that you figured this out. This was a life saver for me. I had a Flow that broke within the last month and a half after working for about a year before that because of this syntax change.

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate 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!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors
Users online (6,724)