UpdateListItems with Multi-select Lookup

Aug 16, 2011 at 12:44 AM

There have been a few discussion on the topic of setting lookups and fields with multiple values using the batch commands but I have a slightly different error.

I have a multi-select lookup column and no matter how I parse the value and text of the lookup, the xmlresponse would have a '0x00000000' error code, but a blank value for the Lookup column (thus, not setting the column).

While debugging, I changed the column to a single selection Lookup and the xmlresponse would have everything up to the first ':#' delimiter as the new value, but the list item still does not have a value in the lookup column.

Has anyone come up against this issue before?

Aug 16, 2011 at 12:49 AM
Is that ":#"? If so, it needs to be ";#". Assuming that's just a typo, can you post the code you ae having trouble with?

Aug 16, 2011 at 1:07 AM
Edited Aug 16, 2011 at 5:43 AM

Yup, definitely a typo.



        operation: "UpdateListItems",
        async: false,
        batchCmd: "New",
        listName: listName,
        listURL: listURL,
        valuepairs: [["Title", titletext], ["Answer", answerText], ["Multiselect_x0020_Lookup_x0020_Field", lookupVal]],
        completefunc: function(xData, Status) {



I've tried setting lookupVal to "1;#Title" (as a single option lookup) as well as "1;#Title;#2;#Title" and "1;#;#2" (multi-select)


For the first scenario, the response is <z:row... Multiselect_x0020_Lookup_x0020_Field="1;#" ...> regardless of how many values are passed (which makes sense), when set to a multi-select, the resonse is <z:row... Multiselect_x0020_Lookup_x0020_Field="" ...> with no error.

Aug 16, 2011 at 1:08 AM

(but the Lookup column of the new item is always empty)

Aug 17, 2011 at 2:27 PM
Edited Aug 17, 2011 at 2:27 PM


Take a look at my blog post and see if it helps.


Aug 17, 2011 at 11:26 PM

Thanks, Marc. The bit on 'nulling out' values was an eye opener.