Skip to content

Unable to update fields of driveitem using '.ItemWithPath(documentSetName).PatchAsync(driveItem)' #2851

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
spmanjunath opened this issue Mar 7, 2025 · 0 comments

Comments

@spmanjunath
Copy link

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant