SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to retrieve the selected values of multi select lookup column and store them in array and then set the lookup column with the same selected values after drop down value changes but always the value is returned as blank ... It works fine in case of single select look up column. Please help ........ I am really going mad with this issue :(

function getWebSiteData() 
    clientContext = new SP.ClientContext.get_current();
    if (this.clientContext != undefined && clientContext != null)

            var webSite = clientContext.get_web();
            oList  = webSite.get_lists().getByTitle("Add New User");
            $.urlParam = function(name)
                var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href);
                    return results[1] || 0;
        var itemid = parseInt($.urlParam('ID'));  
        oListItem = oList.getItemById(itemid); 

        clientContext.executeQueryAsync(Function.createDelegate(this, this.success), Function.createDelegate(this, this.failed));                        
function success(sender,args)
    **alert(oListItem.get_item("System").get_lookupId()); // this is null always**


function failed(sender, args) {
alert("failed. Message:" + args.get_message());

Thanks for your update, I saved the values to array using js code but can you tell me how to assign array values back to the right hand side of Multi-select lookup column on change of a drop down value, this also happens without save button being clicked.

share|improve this question

The following code should work for you:

function success(sender,args)
        var itemArray = new Array();
        itemArray = oListItem.get_item("System");

            for (var i = 0; i < itemArray.length; i++) {
                var lookupObject = itemArray[i];
               // get_lookupId() and get_lookupValue() can be used to get the id and the value of the lookup field.
               alert(lookupObject.get_lookupId() + ” ” + lookupObject.get_lookupValue());

More details here:

UPDATE: This way, you wont be able to get those values on click of the add button as the values are not yet stored in the list item. These values are stored only when you click the save button of the form.

If you want to get the values on click of the add button, you can use simple jquery/javascript to fetch the values from the right side box and store it in a array.

The client object model will only be able to fetch the value if it is stored in the list item.

share|improve this answer

get_item() on a field that allows multiple values will return an array, so get_lookupId will be null. You'll need to do something like this:

for(var i = 0; i < oListItem.get_item("System").length; i++)
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.