This project has moved. For the latest updates, please go here.

Approving/Rejecting list items using SPServices

Sep 15, 2011 at 11:44 AM
Edited Sep 15, 2011 at 11:48 AM


I would like to approve single, multiple list items using SPServices.

I tried to use:


operation: "UpdateListItems",   

async: false,

batchCmd: "Update",       

listName: "Project Resources",     

valuepairs: [["_ModerationStatus", "Approved"], ["Editor", ph.thisGetFullUserName()]],     

 ID: id,

but the item is not approved, it comes back as: ows__ModerationStatus="2" 

I tried different variations eg: [["_ModerationStatus", "0"] or without providing Editor but no luck.

Is it possible to do this at all?

Appreciate any suggestion



Sep 15, 2011 at 11:56 AM
Edited Sep 15, 2011 at 11:58 AM

Looks like the answer is to use 

 Cmd='Moderate' and ["_ModerationStatus", "0"] to approve

In case someone needs it


Sep 1, 2012 at 3:43 AM
Edited Sep 3, 2012 at 12:31 AM

Thanks golka! I needed this tonight and you saved me some time...

For posterity, here's what the batch looks like:


		var updateModStatus = 	"<Batch OnError='Continue'>" + 
						"<Method ID='1' Cmd='Moderate'>" +
							"<Field Name='ID'>" + projectID + "</Field>" + 
						       	"<Field Name='_ModerationStatus'>0</Field>" +
						 "</Method>" +