This project has moved and is read-only. For the latest updates, please go here.



Web Service





  • This operation accepts a webURL option. This allows you to change the context for the operation to a different site. Using a GUID for the listName does NOT change the context as it does with the Object Model, so you need to use the webURL option as well if your list is in a different site.


This is an example from  MartijnMolegraaf.

// Update default values of the metadata fields
var fieldsToUpdate = '<Fields>';
fieldsToUpdate += '<Method ID="1"><Field Type="Text" Name="ProjectName" DisplayName="Project name"><Default>' + projectName + '</Default></Field></Method>';
fieldsToUpdate += '<Method ID="2"><Field Type="Text" Name="MarinProjectNumber" DisplayName="Project number"><Default>' + projectNumber + '</Default></Field></Method>';
fieldsToUpdate += '<Method ID="3"><Field Type="Text" Name="CustomerNumber" DisplayName="Customer number"><Default>' + customerNumber + '</Default></Field></Method>';
fieldsToUpdate += '<Method ID="4"><Field Type="Text" Name="CustomerName" DisplayName="Customer name"><Default>' + customerName + '</Default></Field></Method>';
fieldsToUpdate += '</Fields>';

$().SPServices({ operation: "UpdateList", listName: "Documents", listProperties:"", updateFields: fieldsToUpdate, newFields: "", deleteFields: "", listVersion: "", async: false, completefunc: function (xData, Status){} });

Last edited Oct 10, 2012 at 4:31 AM by sympmarc, version 3


grayaj88 Apr 29, 2016 at 7:38 PM 
Is there a way to update a list with Site Columns?

codemonkey09 Jul 27, 2015 at 7:53 PM 
Here is an example of enabling versioning. I am doing this right after creation in order to get the version number. Not sure if version is required or not but saw it in the msdn documentation.
operation: "AddList",
listName: title,
completefunc: function(xData, Status) {
var version = "";
$(xData.responseXML).find("List").each(function() {
var $list = $(this);
version = $list.attr("Version");
operation: "UpdateList",
listName: title,
listProperties:"<List EnableVersioning='TRUE' />",
newFields: "",
deleteFields: "",
listVersion: version,
completefunc: function(xData, Status) {
} });

AymKdn Jun 20, 2014 at 1:53 PM 
There is an interesting information about the order of the properties and the name we need to use :