Others

How to Add or Update SharePoint List Items Using jQuery

Camila MilosovichCamila Milosovich Nov 2, 2026 869 views

Question details

The user wants to programmatically insert or update items in a SharePoint list using jQuery.

How to Add or Update SharePoint List Items Using jQuery
Product
Microsoft SharePoint
Device & OS
not provided
Scenario
Performing client-side development to manipulate SharePoint list data via custom scripts.
Observed behavior
Seeking the correct AJAX request structure and community developer resources to successfully execute client-side API calls for list manipulation.
Before you start

Ensure you have the appropriate site permissions to read and write to the target SharePoint list, and verify the internal names of the columns you intend to update before writing your script.

Solution 1Recommended

Utilize the SharePoint REST API with jQuery AJAX

The recommended approach for client-side SharePoint interactions is to use the SharePoint REST API via authenticated jQuery AJAX calls.

Adding or updating SharePoint list items via jQuery requires a clear understanding of the REST endpoints and authentication tokens. Because standard support forums focus on built-in features, writing custom AJAX scripts is best achieved using the REST framework.

When performing create or update operations, you must include the X-RequestDigest header to authenticate the request and define the specific metadata type of the list.

1
Determine the REST Endpoint

Construct the URL for your AJAX call. To add or update items, use the endpoint format: 'https://your-site-url/_api/web/lists/getbytitle('ListName')/items'.

2
Define the Item Metadata

Create a JSON object containing the data you want to insert. Make sure to specify the '__metadata' type property, which usually looks like 'SP.Data.ListNameListItem'.

3
Configure Request Headers

Set your AJAX headers to include 'Accept': 'application/json;odata=verbose', 'Content-Type': 'application/json;odata=verbose', and most importantly, the 'X-RequestDigest' value fetched from the SharePoint page context.

4
Execute the AJAX Request

Use jQuery.ajax() to send a POST request for adding new items. If you are updating an existing item, append the item ID to your endpoint URL and include the 'X-HTTP-Method': 'MERGE' and 'IF-MATCH': '*' headers.

Utilize the SharePoint REST API with jQuery AJAX
Troubleshooting Code: If you encounter errors during implementation, gather your list name, internal column names, request URL, and JSON payload, then post them to the Microsoft Q&A SharePoint Development forum or StackOverflow for specialized code assistance.
Free Microsoft Office alternative

Boost Your Productivity with WPS Office

While configuring client-side scripts for SharePoint requires specialized developer knowledge, your everyday document, spreadsheet, and presentation tasks shouldn't be complicated. WPS Office provides a free, lightweight, and highly compatible alternative to Microsoft Office, letting you focus on your work seamlessly.

  1. 1. Download WPS Office: Visit the official WPS website to download the free installation package for your operating system.
  2. 2. Install the Application: Run the installer and follow the simple on-screen instructions to set up the software in minutes.
  3. 3. Open and Edit Microsoft Formats: Launch WPS Office and directly open any .docx, .xlsx, or .pptx files to enjoy seamless editing and high compatibility.
Fully compatible with Microsoft Word, Excel, and PowerPoint formatsLightweight architecture ensures fast performance even on older devicesFamiliar and intuitive user interface requires zero learning curveRobust built-in PDF editing and conversion tools available for free
microsoft office alternative - wps office

Frequently Asked Questions

What is the correct endpoint URL to add an item to a SharePoint list?

The standard REST endpoint for adding an item is 'https://<site-url>/_api/web/lists/getbytitle('<list-title>')/items'. Ensure you replace the placeholders with your actual site URL and list title.

Why am I getting a '403 Forbidden' access denied error when making an AJAX POST request?

This error typically occurs when the 'X-RequestDigest' header is missing, invalid, or expired. You must pass the current request digest value from the page context ('$('#__REQUESTDIGEST').val()') in your AJAX headers.

How do I find the internal name of a SharePoint column?

Go to your SharePoint List Settings, click on the column name you want to update, and look at the URL in your browser. The text following 'Field=' at the end of the URL is the internal name of that column.

Can I use legacy SOAP web services instead of the REST API?

While older versions of SharePoint supported SOAP web services (lists.asmx), this method is considered legacy. Microsoft strongly recommends using the REST API for modern client-side development as it is faster and uses JSON.