How can I use ge/le to filter businessPhones

Aron Hegedus 26 Reputation points
2022-03-30T11:03:21.263+00:00

On the page about Advanced query capabilities on Azure AD directory objects here: https://learn.microsoft.com/en-us/graph/aad-advanced-queries?tabs=http
it says that you can use "eq/startsWith/ge/le" on businessPhones. When I query the /users endpoint, the businessPhones is a list. How can I use the le and ge on this? I know that if I want to do the startsWith, the I need to give the header ConsistencyLevel: eventual , and ask for something like https://graph.microsoft.com/v1.0/users?$filter=businessPhones/any(p:startsWith(p, '4'))&$count=true

188404-quesiton-business.jpg

But I can't figure out how the le or ge would even work, as the phone numbers are integers, they're strings. And I don't think you can filter on the LENGTH of the businessPhones.

Thanks,
Aron

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,002 questions
0 comments No comments
{count} votes

Accepted answer
  1. Zehui Yao_MSFT 5,856 Reputation points
    2022-03-31T09:05:44.28+00:00

    Hello @Aron Hegedus , I tested locally, and here is the manually method of using le and ge operators:

    GET https://graph.microsoft.com/v1.0/users?$filter=businessPhones/any(p:p le '3')&$count=true  
    

    188639-image.png

    GET https://graph.microsoft.com/v1.0/users?$filter=businessPhones/any(p:p ge '3')&$count=true  
    

    188654-image.png

    and here is the documentation for evaluating matches on multi-valued properties:
    188665-image.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


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.