I am trying to filter users having certain schemaExtension and assignedPlan. But i receive an error response.
here is my request, and schemaExtension i used.
Response can be seen below.
{
"error": {
"code": "Request_BadRequest",
"message": "Unrecognized 'Edm.String' literal 'guid'4828c8ec-dc2e-4779-b502-87ac9ce28ab7'' at '39' in 'assignedPlans/any(x:x/servicePlanId eq guid'4828c8ec-dc2e-4779-b502-87ac9ce28ab7' and capabilityStatus eq 'Enabled') and e2_7a1a4a282deb46ab9b054b0186f0f945_exthpvhyp3h_imported/isImported eq true'.",
"innerError": {
"date": "2021-03-15T11:45:39",
"request-id": "e36d0163-7486-4c0c-aa26-9ef2f815b416",
"client-request-id": "3cf2d2a3-59d1-4b7a-e5ee-c54a16a82ce3"
}
}
}
How can i filter based on assignedPlans and schemaExtension at the same time?
You can filter assignedPlans using the below query.
https://graph.microsoft.com/beta/users?$count=true&$filter=assignedPlans/any(a:a/servicePlanId eq bf6f5520-59e3-4f82-974b-7dbbc4fd27c7 and a/capabilityStatus eq 'Enabled')
Add header ConsistencyLevel=eventual
.
But you cannot filter schema extensions as specified in the Known issues document. After getting results from above query, use that data and filter it on your end by writing the code.