question

berlitz-3009 avatar image
0 Votes"
berlitz-3009 asked DanKershaw-5643 answered

Filter not-equal groupTypes

I've seen the example to list all groups where the Type equals Microsoft365('Unified')
https://graph.microsoft.com/v1.0/groups?$filter=groupTypes/any(c:c+eq+'Unified')

Also another page states ne (not equal) is valid. However I didn't find a way to create a query which gets all Groups where the type is not Unified. I feel the documentation doesn't make quite clear how the /any(c:c [...]) works.

I tried (see below) which don't seem to be supported.
https://graph.microsoft.com/v1.0/groups?$filter=groupTypes/any(c:c+ne+'Unified')
https://graph.microsoft.com/v1.0/groups?$filter=groupTypes/all(c:c+ne+'Unified')

microsoft-graph-groups
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

DanKershaw-5643 avatar image
0 Votes"
DanKershaw-5643 answered

@berlitz-3009 sorry for the late response.
This query is possible using advanced query capabilities - see https://docs.microsoft.com/en-us/graph/aad-advanced-queries. To "activate" advanced queries you'll need to set an additional HTTP header and add $count to the query parameters. Rather than use a "ne" (which is not supported in Lambda functions) or the any() Lambda function (also not yet supported), you can instead try this using the "not" operator:

GET https://graph.microsoft.com/v1.0/groups?$filter=not groupTypes/any(c:c+eq+'Unified')&$count=true
ConsistencyLevel: eventual

Hope this helps
Dan

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.