If you are targeting an on-premises version of SharePoint, you can use a Script Editor or Content Editor web part and code similar to that shown in this blog post: Update ListItem in SharePoint using REST API
function UpdateListItemUsingItemId(Id) {
$.ajax
({
// _spPageContextInfo.webAbsoluteUrl - will give absolute URL of the site where you are running the code.
// You can replace this with other site URL where you want to apply the function
url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getByTitle('list name')/items(" + Id +")",
type: "POST",
headers:
{
// Accept header: Specifies the format for response data from the server.
"Accept": "application/json;odata=verbose",
//Content-Type header: Specifies the format of the data that the client is sending to the server
"Content-Type": "application/json;odata=verbose",
// IF-MATCH header: Provides a way to verify that the object being changed has not been changed since it was last retrieved.
// "IF-MATCH":"*", will overwrite any modification in the object, since it was last retrieved.
"IF-MATCH": "*",
//X-HTTP-Method: The MERGE method updates only the properties of the entity , while the PUT method replaces the existing entity with a new one that you supply in the body of the POST
"X-HTTP-Method": "MERGE",
// X-RequestDigest header: When you send a POST request, it must include the form digest value in X-RequestDigest header
"X-RequestDigest": $("#__REQUESTDIGEST").val()
},
data: JSON.stringify({
__metadata:
{
// Format of the "type" is: SP.Data.<<ListName>>ListItem. First character of the <<ListName>> should be in Capital
type: "SP.Data.List_x0020_NameListItem"
},
description: "Updated Description"
}),
success: function(data, status, xhr)
{
console.log("Success");
},
error: function(xhr, status, error)
{
console.log("Failed");
}
});
}
If you are targeting SharePoint Online, then you will want to use the SharePoint Framework an code similar to that shown in this Microsoft Learn module: Work with SharePoint Content using the SharePoint Framework
private _updateListItem(): Promise<SPHttpClientResponse> {
// get the first item
return this.context.spHttpClient.get(
this.context.pageContext.web.absoluteUrl + `/_api/web/lists/getbytitle('Countries')/items?$select=Id,Title&$filter=Title eq 'United States'`,
SPHttpClient.configurations.v1)
.then(response => {
return response.json();
})
.then(jsonResponse => {
return jsonResponse.value[0];
})
.then((listItem: ICountryListItem) => {
// update item
listItem.Title = 'USA';
// save it
const request: any = {};
request.headers = {
'X-HTTP-Method': 'MERGE',
'IF-MATCH': (listItem as any)['@odata.etag']
};
request.body = JSON.stringify(listItem);
return this.context.spHttpClient.post(
this.context.pageContext.web.absoluteUrl + `/_api/web/lists/getbytitle('Countries')/items(${listItem.Id})`,
SPHttpClient.configurations.v1,
request);
});
}
Both of these examples are using the SharePoint REST API to perform the update. For more information on working with lists and list items with the SharePoint REST API, see Working with lists and list items with REST