How to Query OR condition in Graph API

67868880 106 Reputation points
2023-03-18T02:07:43.0433333+00:00

I am trying to run OR condition to find users with either of license assigned but its not working. Can someone please help to correct it ?

https://graph.microsoft.com/v1.0/users?$filter=assignedLicenses/any(x:x/skuId eq '18181a46-0d4e-45cd-891e-60aabd171b4e' or x/skuId eq '06ebc4ee-1bb5-47dd-8120-11324bc54e06')

Microsoft 365
Microsoft 365
Formerly Office 365, is a line of subscription services offered by Microsoft which adds to and includes the Microsoft Office product line.
3,734 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,508 questions
0 comments No comments
{count} votes

Accepted answer
  1. Vasil Michev 94,521 Reputation points MVP
    2023-03-18T07:41:40.4+00:00

    The below should work:

    https://graph.microsoft.com/beta/users?$filter=assignedLicenses/any(x:x/skuId+eq+18181a46-0d4e-45cd-891e-60aabd171b4e) or assignedLicenses/any(x:x/skuId+eq+06ebc4ee-1bb5-47dd-8120-11324bc54e06)&$count=true

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful