microsoftgraph / microsoftgraph/msgraph-sdk-dotnet

There is a bug in versions >= SDK 5.47 (Kiota change?) when fetching a multivalued list item from sharepoint

Open
#2,459 4 comments 2 reactions 1 assignee View on GitHub

@andrueastman is already working on this.

Since May 30, 2024.

priority:p1 type:bug
Dominant language
C#
Stars
789
Forks
264
Avg merge
15h 17m
Merged PRs (30d)
3

Description

Describe the bug

We fetch items from a sharepoint list like this:

var graphItems = graphClient.Sites[siteId].Lists[listId].Items;
var listItems = await graphItems.GetAsync(o => o.QueryParameters.Expand = new[] { "Fields" }); 

Then serialize and print one item in the list:

var dic = item.Fields.AdditionalData;
var json = JsonSerializer.Serialize(dic);

In SDK versions prior to 5.47, the output would look like this (I am only showing the property that has the issue):

{"RenewalStatus":[{"LookupId":6,"LookupValue":"Dead - see general status"},{"LookupId":21,"LookupValue":"Removed at CPA"}]}

In SDK versions from 5.47 onwards (tested to 5.50) the output to the same item is this:

{"RenewalStatus":{}}

When I look the AdditionalData dictionary, the type of the property in question was previously an array, but from 5.57 onwards it is Microsoft.Kiota.Abstractions.Serialization.UntypedArray.

Expected behavior

I believe I have described the steps to reproduce in the question, but in the sharepoint list the field is a "Lookup" field with allow multiple values enabled.

How to reproduce

As per the code in my description.

SDK Version

5.47 to latest (5.50)

Latest version known to work for scenario above?

5.46 and before

Known Workarounds

I am fixing our projects to Graph 5.46 until this is fixed or until it is clearer why this information is not being returned in the last few versions of the SDK. This is clearly an SDK change and not a sharepoint change given reverting to the older SDK resolves the issue.

Debug output
Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.