When using filter on the graph API, how to do you only return data where a field / property isn't blank
currenty doing https://graph.microsoft.com/beta/users?$filter=EmployeeId ge '!' but these doesn't seem the correct way to do this... doing EmployeeId ne '' isn't allowed it seems. This field is blank not null when not filled in, atleast in my tenant anyway.
...
"displayName": "Test Example",
"employeeId": "000Blah",
...
Any one able to confirm if this is the correct way?
Basicly only want to return the records where people do have their employeeId filled in.
This should do the job
https://graph.microsoft.com/beta/users?$filter=userType eq 'Member' and employeeId ge ' '
Please notice the space.
There currently is no filter capability in graph on the users endpoint to do null(or empty) filtering. I believe there are requests all over the internet asking microsoft to implement it, however as it stands, there is no correct way to do it. your work around seems as good as any.
Here is a user voice request for it https://microsoftgraph.uservoice.com/forums/920506-microsoft-graph-feature-requests/suggestions/36040288-useful-user-endpoint-filtering you can vote for it
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With