How to update a sharepoint multi value person/group field with graph

Ferdieh 0 Reputation points
2025-01-31T07:53:35.84+00:00

I want to update a multi value person field within a SharePoint list. I use the following code. But nothin will hapen. I can update a single value person field but i am unable to update a multi value field. Also Co-pilot doesn't give me much help.

# Create the request body
$body = @{
    "multiperson" = "******@xxxxx.com"
} | ConvertTo-Json

# Create the request headers

# Compose the request URL
$url = "https://graph.microsoft.com/v1.0/sites/$siteId/lists/$listId/items/$itemId/fields/"

# Send the PATCH request
Invoke-MgRestMethod -Uri $url -Method Patch -Body $body
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,310 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
11,230 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,879 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. AllenXu-MSFT 24,516 Reputation points Microsoft External Staff
    2025-02-03T06:21:41.8866667+00:00

    Hi @Ferdieh,

    To update a SharePoint multi value person/group field with graph, please take a reference to the below threads.

    You need to specify the data type first and pass the ids as an array for multi-valued Person/group field.

    Url: https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items/{item-id}/fields    
    Method: PATCH 
    {
        "******@odata.type": "Collection(Edm.String)",
        "CategoryLookupId":["1","2"]
    }
    

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.