How to Add or Update SharePoint List Items Using jQuery
Question details
The user wants to programmatically insert or update items in a SharePoint list 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.
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.
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.
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'.
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'.
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.
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.

Consult Dedicated Developer Forums for Scripting Support
Since standard support channels often do not provide custom code solutions, redirecting your inquiries to dedicated developer communities yields the best results.
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. Download WPS Office: Visit the official WPS website to download the free installation package for your operating system.
- 2. Install the Application: Run the installer and follow the simple on-screen instructions to set up the software in minutes.
- 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.

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.




