lambdamicrosoft-graph-apimicrosoft-graph-calendar

Are lambda filters on subproperties of calendar event collections allowed?


The documentation about lambda operators has some examples of filtering on subproperties that work fine in Graph Explorer:

https://graph.microsoft.com/v1.0/users?$filter=imAddresses/any(i:i eq 'admin@contoso.com')
https://graph.microsoft.com/v1.0/users?$filter=assignedLicenses/any(s:s/skuId eq 184efa21-98c3-4e5d-95ab-d07053a96e67)

But queries like these on calendar event complex property collections give me 'invalid filter' error messages:

https://graph.microsoft.com/v1.0/me/calendar/events?$filter=attendees/any(e:e/emailAddress eq '')
https://graph.microsoft.com/v1.0/me/calendar/events?$filter=location/any(i:i/address eq 'here')

A query on the simple event string collection 'categories' works:

https://graph.microsoft.com/v1.0/me/calendar/events?$filter=categories/any(i:i eq 'something')

Are lambda filters on subproperties of calendar event collections (not) allowed?
Is my query syntax incorrect?

(Tested with consistencylevel:eventual header, which seems to be unnecessary)


Solution

  • According this comment Graph API doesn't support filter events by attendees.

    For filtering events by location and its displayName use

    GET https://graph.microsoft.com/v1.0/me/calendar/events?$filter=location/displayName eq 'Microsoft Teams Meeting'
    

    But filtering events by locations returns empty results for me

    GET https://graph.microsoft.com/v1.0/me/calendar/events?$filter=locations/any(e:e/displayName eq 'Microsoft Teams Meeting')
    

    From my experience filtering Graph API resources by a collection property differs from resource to resource. Sometimes it's working fine sometimes it's not supported.