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

How to update multiple ListItems with a “Where Clause” using SPServices ?

Feb 22, 2010 at 10:29 AM

I've searched the jQuery SPServices code examples and MSDN references for an simple example how to update several ListItems using a Where-Clause.

Code for updating a single ListItem with ID = 500, looks like this:

: "UpdateListItems",
: "MyList",
: 500,
: [["MyField", 1]],
: function (xData, Status) {

But is it also possible to add a Where like :

<Where><Eq><FieldRef Name="Status"/><Value Type="Text">Ready</Value></Eq></Where>

Or should I do it like this post ? (First retrieve the list and then do a loop for each item ?)

(Sorry for cross posting this question, it's also posted here.)


Feb 22, 2010 at 5:21 PM
Edited Feb 22, 2010 at 5:21 PM

I use the second method almost exclusively, if you take a look at this page in the documentation you'll see an example of how to implement the "updates" parameter: UpdateListItems

Mar 1, 2010 at 9:12 PM


You do need to follow the two step method, as show in the thread you highlighted.  I'm hoping that you solved your issue, but post back if you need more help.


Mar 2, 2010 at 9:32 AM

Hi sympmarc and webdes03,

Thanks for your help, now I know that the 2 step way is at this moment the correct way.

Best regards,

Mar 2, 2010 at 4:38 PM

At some point, maybe it would make sense to have a function that wraps these two steps together, but I'm not sure that it's much value add, really.  Let me know if you need any help with things.