Allow filtering users by officeLocation
While filtering works for some attributes like department it doesn't work for officeLocation, which sadly I need for my use case.
GET https://graph.microsoft.com/beta/users?$filter=officeLocation eq 'Gaithersburg, MD'
"message": "Unsupported or invalid query filter clause specified for property 'officeLocation' of resource 'User'.",
This capability is now available in Microsoft Graph public preview. It’s not currently documented.
NOTE: you’ll need to use a custom HTTP request header ConsistencyLevel: eventual and request $count=true as well, to enable this query capability.
GET ../beta/users?$filter=officeLocation eq ‘SomeLocation’&$count=true
See also related queries in the changelog entry https://docs.microsoft.com/en-us/graph/changelog#identity-and-access-azure-ad
Martin Petvalsky commented
all the string properties should be filterable
Very good news ! Thanks for the adding
Fail to understand why every other property is query able except officeLocation.
Kuzma Fesenko commented
I too would find it incredibly useful to filter by officeLocation. I can't imagine this would be too challenging to implement.