Update an item in a list

Important

APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported.

Update the properties on a listItem.

Permissions

One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

Permission type Permissions (from least to most privileged)
Delegated (work or school account) Sites.ReadWrite.All
Delegated (personal Microsoft account) Not supported.
Application Sites.ReadWrite.All

HTTP request

PATCH https://graph.microsoft.com/beta/sites/{site-id}/lists/{list-id}/items/{item-id}/fields

Optional request headers

Name Value Description
if-match etag If this request header is included and the eTag provided does not match the current eTag on the item, a 412 Precondition Failed response is returned and the item will not be updated.

Request body

In the request body, supply a JSON representation of a fieldValueSet specifying the fields to update.

Example

Here is an example that updates the Color and Quantity fields of the list item with new values. All other values on the listItem are left alone.

PATCH https://graph.microsoft.com/beta/sites/{site-id}/lists/{list-id}/items/{item-id}/fields
Content-Type: application/json

{
    "Color": "Fuchsia",
    "Quantity": 934
}

Response

If successful, this method returns a fieldValueSet in the response body for the updated list item.

HTTP/1.1 201 Created
Content-type: application/json

{
  "Name": "Widget",
  "Color": "Fuchsia",
  "Quantity": 934
}

SDK sample code


const options = {
	authProvider,
};

const client = Client.init(options);

const fieldValueSet = {
    Color: "Fuchsia",
    Quantity: 934
};

let res = await client.api('/sites/{site-id}/lists/{list-id}/items/{item-id}/fields')
	.version('beta')
	.update({fieldValueSet : fieldValueSet});

Read the SDK documentation for details on how to add the SDK to your project and create an authProvider instance.