microsoftgraph / microsoftgraph/msgraph-sdk-dotnet

Items GetAsync with Filter on Name, expect 1 result but get 0

Open
#2,700 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Needs: Attention :wave:
Dominant language
C#
Stars
789
Forks
264
Avg merge
15h 17m
Merged PRs (30d)
3

Description

I've found that using filter on a folder (in this case my root / Shared Documents in SharePoint) it doesn't return the folder


var folderSearch = await serviceClient!
            .Drives[drive.Id]
            .Items
            .GetAsync(cfg => cfg.QueryParameters.Filter = "name eq 'myfolderthatexists'");

Since my folder has 200+ items in it, I used PageIterator (since I saw ONextDataLink being returned) and saw I had to page to the item before it returns?

The expectation of Filter (at least in my opinion) should return that driveitem only

I don't mind using PageIterator, as soon as I detect the Item I just return false to stop it. I'm just wondering why the filter returns empty pages until it's on the page it expects?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Drives[drive.Id].Items.GetAsync request with the name filter against a folder containing more than 200 items. Compare the filtered pages with the PageIterator behavior and determine whether the observed empty pages match the SDK or service response. Done means the filtering behavior is explained and the expected result or limitation is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.