Can't use all or not filter functions with array of primitive types

Joe Thorpe 1 Reputation point

I'm using the /events route (with both v1.0 and beta), and trying to get events which don't have a specific category.

The following $filter queries don't work:

not(categories/any(c:c eq 'Tracked to Dynamics 365')) => "An internal server error occurred. The operation failed."

This filter is documented here:*

categories/all(c:c ne 'Tracked to Dynamics 365') => "The query filter contains one or more invalid nodes."

This filter is documented here:

not categories/any(c:c eq 'Tracked to Dynamics 365') => "An internal server error occurred. The operation failed."

This filter is documented as an advanced query with the ConsistencyLevel: eventual header. I don't think this entity supports advanced queries, so i don't expect this one to work.

I would expect the first two filters to work.

Just to see if any collection functions work, i tried the following filter, which does work (i.e. the request returns results).

categories/any(c:c ne 'Tracked to Dynamics 365')

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,449 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous

    Hi @Joe Thorpe ,

    Thanks for reaching out!

    As per the documentation filter collection complex types, the suggested way for filtering not equal is not(categories/any(c:c eq 'Orange category')

    I am able to return results by using this query $filter=not(categories/any(c:c eq 'Orange category')) by applying filtering on me/messages endpoint.

    But for me/events as you mentioned it is working with $filter=categories/any(c:c ne 'Orange category').

    Unlike this isn't an expected behavior, I would suggest you submit request in or you can raise support ticket from or

    Hope this helps.

    If the reply is helpful, please click "Accept Answer" and kindly upvote it. If you have additional questions about this answer, please click "Comment".

    0 comments No comments