question

DanielPan-8036 avatar image
0 Votes"
DanielPan-8036 asked

Filter out empty arrays in Microsoft Graph

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-users
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

michev avatar image
0 Votes"
michev answered JosephXu-MSFT commented

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.

· 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.

Graph does not support to filter out empty collections for entities. We can create a feedback here.

1 Vote 1 ·