Share via

Bug? filter startswith property value set to empty is not supported

Ozair 116 Reputation points
Aug 16, 2021, 11:23 AM

Trying to get users with startswith filter where property value is set to empty.

End Point : https://graph.microsoft.com/v1.0/users/?$count=true&$filter= startswith(displayName, '')

Expected Value : return empty list.

Actual Value : Error

{
"error": {
"code": "Request_UnsupportedQuery",
"message": "Unsupported or invalid query filter clause specified for property 'displayName' of resource 'User'.",
"innerError": {
"date": "2021-08-16T11:08:45",
"request-id": "00000000-0000-0000-0000-000000000000",
"client-request-id": "00000000-0000-0000-0000-000000000000"
}
}

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,116 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
23,348 questions
0 comments No comments
{count} votes

Accepted answer
  1. Vasil Michev 114.1K Reputation points MVP
    Aug 16, 2021, 12:40 PM

    Pretty sure the method expects a non-null string. If the idea is to filter out any users with "empty" displayName values, use advanced queries as detailed here: https://learn.microsoft.com/en-us/graph/aad-advanced-queries

    https://graph.microsoft.com/beta/users?$filter=displayName eq null&$count=true  
    

0 additional answers

Sort by: Most helpful

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.