Filter out empty arrays in Microsoft Graph

Daniel Pan 1 Reputation point
2021-07-09T07:37:30.5+00:00

Hi team,

I found that there was an example of Use $filter to get users who are assigned a specific license, here is the request:

GET https://graph.microsoft.com/v1.0/users?$select=id,mail,assignedLicenses&$filter=assignedLicenses/any(u:u/skuId eq cbdc14ab-d96c-4c30-b9f4-6ada7cdc1d46)

I am looking for a way to filter out empty assignedLicenses, and the expected response value from the request is that all user's assignedLicenses is Non Empty Arrary

Please advise me,

Cheers

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

1 answer

Sort by: Most helpful
  1. Vasil Michev 105.6K Reputation points MVP
    2021-07-09T09:53:14.687+00:00

    Do yourself a favor and filter client-side, whatever basic filtering capabilities we currently have in the Graph are not worth the trouble. For example, your scenario could easily be addressed by a "not equal" operator... but the Graph does not support this.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.