Skip to content

Skip parameter for User / Group search #2914

@ssteiner

Description

@ssteiner

Describe the bug

I'm trying to extract users in pages and I found something peculiar:
The UsersRequestBuilderGetQueryParameters class has the Top parameter. But no Skip parameter. So, when I search with a filter, and my frontend requested the first 20 entries, I'd fill out Top = 20. And get what I want. If the frontend user decides, 'I need to see the next 20', I'd have to request Top = 40, and discard the first 20.

Whereas, if I do the same for Groups, the GroupsRequestBuilderGetQueryParameters has both Top and Skip parameters, allowing me to request entries only 20-40.

But, maybe it's the Groups API that is wrong. The documentation states that the $skip parameter isn't supported

Either way.. if the documentation is wrong and $skip is allowed, it ought to be in both QueryParameter classes, if the documentation is wrong and $skip is not supported for either User and Group, then it should be removed from GroupsRequestBuilderGetQueryParameters

Expected behavior

I'd like to be able to use Skip for user searches as well.

How to reproduce

Search users on your GraphServiceClient as follows (GraphServiceClient instantiation omitted for brevity)

var items = await graphServiceClient.Users.GetAsync(requestConfiguration =>
{
    if (attributeList?.Count > 0) requestConfiguration.QueryParameters.Select = attributeList?.ToArray();
    if (!string.IsNullOrEmpty(filter)) requestConfiguration.QueryParameters.Filter = filter;
    if (pageSize > 0) requestConfiguration.QueryParameters.Top = pageSize;
//    requestConfiguration.QueryParameters.Skip = / parameter not found
    if (includeCount)
    {
        requestConfiguration.QueryParameters.Count = true;
        requestConfiguration.Headers.Add("ConsistencyLevel", "eventual");
    }
}).ConfigureAwait(false);

SDK Version

5.79.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output

Configuration

  • OS: Win 11 Professional, x64

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions