4
votes

I am trying to get all users in an office location using Microsoft Graph

I am receiving the following error message:

Unsupported or invalid query filter clause specified for property 'officeLocation' of resource 'User'.

I am using the following uri and filter:

https://graph.microsoft.com/v1.0/users?$filter=officeLocation eq '18/2107'

at the graph explorer here:

https://developer.microsoft.com/en-us/graph/graph-explorer

How can I pull all users for an Office Location?

Thanks!

2

2 Answers

2
votes

Unfortunately this property on user is not filterable. If this is something important, please file a request for this on Uservoice: https://officespdev.uservoice.com/forums/224641-feature-requests-and-feedback/category/101632-microsoft-graph-o365-rest-apis

Hope this helps,

1
votes

Filter on officeLocation is not available till date, we can query for all user than can filter out from that based on officeLocation, API will not return all user in one call, Microsoft Graph will continue to return a reference to the next page of data in the @odata:nextLink property with each response until all pages of the result have been read.You can retrieve the next page of results by sending the URL value of the @odata:nextLink property to Microsoft Graph.