Graph Explorer does not provide $count

Long 20 Reputation points
2024-11-21T09:55:46.0366667+00:00

I am trying to fetch all the users within a group and I want to count all of them using this below query:

https://graph.microsoft.com/v1.0/groups/xxxxxxxx-xxxxxxxx-xxxxxxx/members?$count=true

or

https://graph.microsoft.com/v1.0/groups/xxxxxxxx-xxxxxxxx-xxxxxxx/members/$count

I also set the ConsistencyLevel to eventual in the request header.

Both queries does not return any count number. Did I miss something?

B2C

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

Accepted answer
  1. CarlZhao-MSFT 42,846 Reputation points
    2024-11-22T01:44:42.2933333+00:00

    Hi @Long

    It is only available in advanced queries.

    User's image

    However, advanced queries do not yet support Azure AD B2C tenants. Therefore, you can only count the returned result set locally.

    User's image

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.


1 additional answer

Sort by: Most helpful
  1. Hitesh Pachipulusu - MSFT 3,310 Reputation points Microsoft Vendor
    2024-11-21T13:51:52.7166667+00:00

    Hello Ngoc Long Luong,

    Thank you for reaching out to Microsoft Support!

    I have tested the same Graph API endpoint and able to get the count of members. Please check below.

    image (15)

    Please check whether you have provided headers correctly.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.


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.