microsoftgraph / microsoftgraph/msgraph-sdk-dotnet
Unable to update fields of driveitem using '.ItemWithPath(documentSetName).PatchAsync(driveItem)'
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 789
- Forks
- 264
- Avg merge
- 15h 17m
- Merged PRs (30d)
- 3
Description
I am trying to update SharePoint's DocumentSet metadata using below code, the call returns 200OK, but nothing is updated. What is wrong with the below code?
var driveItem = new DriveItem
{
Name = "test01",
ListItem = new ListItem
{
Fields = new FieldValueSet
{
AdditionalData = new Dictionary<string, object>
{
{
"CompanyCode" , "test01"
},
{
"CaseStatus" , "InProgress"
}
}
}
}
};
GetGraphClient().Drives[driveId].Root.ItemWithPath(documentSetName).PatchAsync(driveItem);
Note:
- I have read that it is possible to do this update using
lists[listID]/items[itemID], this approach requires 2 calls, first call to get the ItemId, subsequent to update - this would cause performance issues when there many documentsets to be updated. - In Graph SDK 3.4 version it was possible to update fields using
.ListItem.Fields.Request().UpdateAsync- the SDK version 5.7 does not have similar capability.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the provided Drives[driveId].Root.ItemWithPath(documentSetName).PatchAsync entry point and compare it with the lists[listID]/items[itemID] approach described in the issue. Reproduce the request with the shown DriveItem payload, inspect the response and resulting fields, and determine whether SDK 5.7 supports this update path. Done means the supported update route or limitation is clearly established.
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
- 35/100