title: Updating a multi-select lookup column REST
body: <p><strong><em>Short Version:</em></strong>
  I need help or an example of updating a multi-select lookup column REST. I have been unable to add or update the multi-select lookup column. </p>
  
  <hr>
  
  <p>details </p>
  
  <p><strong>What I am trying to do:</strong> 
    Update a list item with updated multiple lookup IDs from a SPA. I would like to understand what I should look for and how to apply it. And i assume that Adding a row would be of the same ilk.  </p>
  
  <p><strong>My imposed limitations:</strong> This has to be done with client side code. I cannot deploy a wsp/binary code. :( SP2010 I am stuck in the dark ages with jQuery 1.8.3 and the site rendering in document mode IE=8 running on IE11.  </p>
  
  <p><strong>What works:</strong>
  All CRUDs not involving multi look ups. Reads with multi look ups is working in a separate call using the <em>...ListName(ID)/MultiLookupCol</em> shape.  </p>
  
  <p><strong>What I have tried or researched:</strong>
  I believe the closest I have gotten is this. However it is still a fail with the <strong>Bad Request Error : Error processing request stream. The payload must represent a valid array format for collections.</strong></p>
  
  <p>So I believe that my properties construction for the multi is as unstable as Charles Manson. Assuming that's my culprit, I don't know how to fix it. </p>
  
  <p>Using     </p>
  
  <pre><code>var itemProperties = {
      "__metadata": { "type": 'Microsoft.SharePoint.DataService.GroupsOfNumbersItem' },
  </code></pre>
  
  <p>stopped the <em>type name error</em> I was getting. Closer but still not there.   </p>
  
  <pre><code>var aIDs = [1, 3];
  var itemProperties = {
      "__metadata": { "type": 'Microsoft.SharePoint.DataService.MyNumbersItem' },
      "ReferenceLookup": { "results": aIDs }
  };
  updateListItem(myWebUrl(), 
                 "GroupsOfNumbers", 
                 1, 
                 itemProperties,
      function () {
          console.log('Success');
      },
      function (error) {
          console.log(JSON.stringify(error));
      }
  );
  </code></pre>
  
  <p>I have read and tried to apply info from a multitude of pages the most pertinent seem to be the following.</p>
  
  <p><a href="https://sharepoint.stackexchange.com/questions/84560/updating-lookup-values-with-the-rest-api">https://sharepoint.stackexchange.com/questions/84560/updating-lookup-values-with-the-rest-api</a></p>
  
  <p><a href="https://sharepoint.stackexchange.com/questions/69983/updating-a-multiselect-field-via-rest-api-2010">https://sharepoint.stackexchange.com/questions/69983/updating-a-multiselect-field-via-rest-api-2010</a></p>
  
  <p><a href="https://sharepoint.stackexchange.com/questions/115950/sharepoint-2013-rest-api-to-update-list-item-uncaught-referenceerror-etag-is-n">https://sharepoint.stackexchange.com/questions/115950/sharepoint-2013-rest-api-to-update-list-item-uncaught-referenceerror-etag-is-n</a></p>
  
  <p><a href="https://blogs.msdn.microsoft.com/uksharepoint/2013/02/22/manipulating-list-items-in-sharepoint-hosted-apps-using-the-rest-api/" rel="nofollow noreferrer">https://blogs.msdn.microsoft.com/uksharepoint/2013/02/22/manipulating-list-items-in-sharepoint-hosted-apps-using-the-rest-api/</a> </p>
  
  <p>I have included results for the following calls from the browser window in hopes it helps. </p>
  
  <p>Results from joedev/mftt/_vti_bin/ListData.svc/GroupsOfNumbers</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" standalone="yes"?&gt;
  &lt;feed xml:base="http://joedev/mftt/_vti_bin/ListData.svc/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom"&gt;
    &lt;title type="text"&gt;GroupsOfNumbers&lt;/title&gt;
    &lt;id&gt;http://joedev/mftt/_vti_bin/ListData.svc/GroupsOfNumbers/&lt;/id&gt;
    &lt;updated&gt;2016-07-09T02:00:17Z&lt;/updated&gt;
    &lt;link rel="self" title="GroupsOfNumbers" href="GroupsOfNumbers" /&gt;
    &lt;entry m:etag="W/&amp;quot;1&amp;quot;"&gt;
      &lt;id&gt;http://joedev/mftt/_vti_bin/ListData.svc/GroupsOfNumbers(1)&lt;/id&gt;
      &lt;title type="text"&gt;My First Test&lt;/title&gt;
      &lt;updated&gt;2016-07-08T21:01:04-04:00&lt;/updated&gt;
      &lt;author&gt;
        &lt;name /&gt;
      &lt;/author&gt;
      &lt;link rel="edit" title="GroupsOfNumbersItem" href="GroupsOfNumbers(1)" /&gt;
      &lt;link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/NumberLookUp" type="application/atom+xml;type=feed" title="NumberLookUp" href="GroupsOfNumbers(1)/NumberLookUp" /&gt;
      &lt;link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/CreatedBy" type="application/atom+xml;type=entry" title="CreatedBy" href="GroupsOfNumbers(1)/CreatedBy" /&gt;
      &lt;link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ModifiedBy" type="application/atom+xml;type=entry" title="ModifiedBy" href="GroupsOfNumbers(1)/ModifiedBy" /&gt;
      &lt;link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Attachments" type="application/atom+xml;type=feed" title="Attachments" href="GroupsOfNumbers(1)/Attachments" /&gt;
      &lt;category term="Microsoft.SharePoint.DataService.GroupsOfNumbersItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /&gt;
      &lt;content type="application/xml"&gt;
        &lt;m:properties&gt;
          &lt;d:ContentTypeID&gt;0x0100F35C84ED82881449AC47D1675F099E2C&lt;/d:ContentTypeID&gt;
          &lt;d:Title&gt;My First Test&lt;/d:Title&gt;
          &lt;d:Id m:type="Edm.Int32"&gt;1&lt;/d:Id&gt;
          &lt;d:ContentType&gt;Item&lt;/d:ContentType&gt;
          &lt;d:Modified m:type="Edm.DateTime"&gt;2016-07-08T21:01:04&lt;/d:Modified&gt;
          &lt;d:Created m:type="Edm.DateTime"&gt;2016-07-08T21:01:04&lt;/d:Created&gt;
          &lt;d:CreatedById m:type="Edm.Int32"&gt;1&lt;/d:CreatedById&gt;
          &lt;d:ModifiedById m:type="Edm.Int32"&gt;1&lt;/d:ModifiedById&gt;
          &lt;d:Owshiddenversion m:type="Edm.Int32"&gt;1&lt;/d:Owshiddenversion&gt;
          &lt;d:Version&gt;1.0&lt;/d:Version&gt;
          &lt;d:Path&gt;/mftt/Lists/GroupsOfNumbers&lt;/d:Path&gt;
        &lt;/m:properties&gt;
      &lt;/content&gt;
    &lt;/entry&gt;
  &lt;/feed&gt;
  </code></pre>
  
  <p>Results from joedev/mftt/_vti_bin/ListData.svc/GroupsOfNumbers(1)</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" standalone="yes"?&gt;
  &lt;entry xml:base="http://joedev/mftt/_vti_bin/ListData.svc/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" m:etag="W/&amp;quot;1&amp;quot;" xmlns="http://www.w3.org/2005/Atom"&gt;
    &lt;id&gt;http://joedev/mftt/_vti_bin/ListData.svc/GroupsOfNumbers(1)&lt;/id&gt;
    &lt;title type="text"&gt;My First Test&lt;/title&gt;
    &lt;updated&gt;2016-07-08T21:01:04-04:00&lt;/updated&gt;
    &lt;author&gt;
      &lt;name /&gt;
    &lt;/author&gt;
    &lt;link rel="edit" title="GroupsOfNumbersItem" href="GroupsOfNumbers(1)" /&gt;
    &lt;link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/NumberLookUp" type="application/atom+xml;type=feed" title="NumberLookUp" href="GroupsOfNumbers(1)/NumberLookUp" /&gt;
    &lt;link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/CreatedBy" type="application/atom+xml;type=entry" title="CreatedBy" href="GroupsOfNumbers(1)/CreatedBy" /&gt;
    &lt;link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ModifiedBy" type="application/atom+xml;type=entry" title="ModifiedBy" href="GroupsOfNumbers(1)/ModifiedBy" /&gt;
    &lt;link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Attachments" type="application/atom+xml;type=feed" title="Attachments" href="GroupsOfNumbers(1)/Attachments" /&gt;
    &lt;category term="Microsoft.SharePoint.DataService.GroupsOfNumbersItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /&gt;
    &lt;content type="application/xml"&gt;
      &lt;m:properties&gt;
        &lt;d:ContentTypeID&gt;0x0100F35C84ED82881449AC47D1675F099E2C&lt;/d:ContentTypeID&gt;
        &lt;d:Title&gt;My First Test&lt;/d:Title&gt;
        &lt;d:Id m:type="Edm.Int32"&gt;1&lt;/d:Id&gt;
        &lt;d:ContentType&gt;Item&lt;/d:ContentType&gt;
        &lt;d:Modified m:type="Edm.DateTime"&gt;2016-07-08T21:01:04&lt;/d:Modified&gt;
        &lt;d:Created m:type="Edm.DateTime"&gt;2016-07-08T21:01:04&lt;/d:Created&gt;
        &lt;d:CreatedById m:type="Edm.Int32"&gt;1&lt;/d:CreatedById&gt;
        &lt;d:ModifiedById m:type="Edm.Int32"&gt;1&lt;/d:ModifiedById&gt;
        &lt;d:Owshiddenversion m:type="Edm.Int32"&gt;1&lt;/d:Owshiddenversion&gt;
        &lt;d:Version&gt;1.0&lt;/d:Version&gt;
        &lt;d:Path&gt;/mftt/Lists/GroupsOfNumbers&lt;/d:Path&gt;
      &lt;/m:properties&gt;
    &lt;/content&gt;
  &lt;/entry&gt;
  </code></pre>
  
  <p>Results from joedev/mftt/_vti_bin/ListData.svc/GroupsOfNumbers(1)/NumberLookUp </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" standalone="yes"?&gt;
  &lt;feed xml:base="http://joedev/mftt/_vti_bin/ListData.svc/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom"&gt;
    &lt;title type="text"&gt;NumberLookUp&lt;/title&gt;
    &lt;id&gt;http://joedev/mftt/_vti_bin/ListData.svc/GroupsOfNumbers(1)/NumberLookUp/&lt;/id&gt;
    &lt;updated&gt;2016-07-09T02:00:10Z&lt;/updated&gt;
    &lt;link rel="self" title="NumberLookUp" href="NumberLookUp" /&gt;
    &lt;entry m:etag="W/&amp;quot;1&amp;quot;"&gt;
      &lt;id&gt;http://joedev/mftt/_vti_bin/ListData.svc/MyNumbers(4)&lt;/id&gt;
      &lt;title type="text"&gt;&lt;/title&gt;
      &lt;updated&gt;2016-07-08T20:55:47-04:00&lt;/updated&gt;
      &lt;author&gt;
        &lt;name /&gt;
      &lt;/author&gt;
      &lt;link rel="edit" title="MyNumbersItem" href="MyNumbers(4)" /&gt;
      &lt;link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/CreatedBy" type="application/atom+xml;type=entry" title="CreatedBy" href="MyNumbers(4)/CreatedBy" /&gt;
      &lt;link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ModifiedBy" type="application/atom+xml;type=entry" title="ModifiedBy" href="MyNumbers(4)/ModifiedBy" /&gt;
      &lt;link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Attachments" type="application/atom+xml;type=feed" title="Attachments" href="MyNumbers(4)/Attachments" /&gt;
      &lt;category term="Microsoft.SharePoint.DataService.MyNumbersItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /&gt;
      &lt;content type="application/xml"&gt;
        &lt;m:properties&gt;
          &lt;d:ContentTypeID&gt;0x0100913060DC06F4DF458B6A06CA950C1149&lt;/d:ContentTypeID&gt;
          &lt;d:Title m:null="true" /&gt;
          &lt;d:NunberName&gt;Five&lt;/d:NunberName&gt;
          &lt;d:Id m:type="Edm.Int32"&gt;4&lt;/d:Id&gt;
          &lt;d:ContentType&gt;Item&lt;/d:ContentType&gt;
          &lt;d:Modified m:type="Edm.DateTime"&gt;2016-07-08T20:55:47&lt;/d:Modified&gt;
          &lt;d:Created m:type="Edm.DateTime"&gt;2016-07-08T20:55:47&lt;/d:Created&gt;
          &lt;d:CreatedById m:type="Edm.Int32"&gt;1&lt;/d:CreatedById&gt;
          &lt;d:ModifiedById m:type="Edm.Int32"&gt;1&lt;/d:ModifiedById&gt;
          &lt;d:Owshiddenversion m:type="Edm.Int32"&gt;1&lt;/d:Owshiddenversion&gt;
          &lt;d:Version&gt;1.0&lt;/d:Version&gt;
          &lt;d:Path&gt;/mftt/Lists/MyNumbers&lt;/d:Path&gt;
        &lt;/m:properties&gt;
      &lt;/content&gt;
    &lt;/entry&gt;
    &lt;entry m:etag="W/&amp;quot;1&amp;quot;"&gt;
      &lt;id&gt;http://joedev/mftt/_vti_bin/ListData.svc/MyNumbers(5)&lt;/id&gt;
      &lt;title type="text"&gt;&lt;/title&gt;
      &lt;updated&gt;2016-07-08T20:55:54-04:00&lt;/updated&gt;
      &lt;author&gt;
        &lt;name /&gt;
      &lt;/author&gt;
      &lt;link rel="edit" title="MyNumbersItem" href="MyNumbers(5)" /&gt;
      &lt;link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/CreatedBy" type="application/atom+xml;type=entry" title="CreatedBy" href="MyNumbers(5)/CreatedBy" /&gt;
      &lt;link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ModifiedBy" type="application/atom+xml;type=entry" title="ModifiedBy" href="MyNumbers(5)/ModifiedBy" /&gt;
      &lt;link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Attachments" type="application/atom+xml;type=feed" title="Attachments" href="MyNumbers(5)/Attachments" /&gt;
      &lt;category term="Microsoft.SharePoint.DataService.MyNumbersItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /&gt;
      &lt;content type="application/xml"&gt;
        &lt;m:properties&gt;
          &lt;d:ContentTypeID&gt;0x0100913060DC06F4DF458B6A06CA950C1149&lt;/d:ContentTypeID&gt;
          &lt;d:Title m:null="true" /&gt;
          &lt;d:NunberName&gt;Four&lt;/d:NunberName&gt;
          &lt;d:Id m:type="Edm.Int32"&gt;5&lt;/d:Id&gt;
          &lt;d:ContentType&gt;Item&lt;/d:ContentType&gt;
          &lt;d:Modified m:type="Edm.DateTime"&gt;2016-07-08T20:55:54&lt;/d:Modified&gt;
          &lt;d:Created m:type="Edm.DateTime"&gt;2016-07-08T20:55:54&lt;/d:Created&gt;
          &lt;d:CreatedById m:type="Edm.Int32"&gt;1&lt;/d:CreatedById&gt;
          &lt;d:ModifiedById m:type="Edm.Int32"&gt;1&lt;/d:ModifiedById&gt;
          &lt;d:Owshiddenversion m:type="Edm.Int32"&gt;1&lt;/d:Owshiddenversion&gt;
          &lt;d:Version&gt;1.0&lt;/d:Version&gt;
          &lt;d:Path&gt;/mftt/Lists/MyNumbers&lt;/d:Path&gt;
        &lt;/m:properties&gt;
      &lt;/content&gt;
    &lt;/entry&gt;
    &lt;entry m:etag="W/&amp;quot;1&amp;quot;"&gt;
      &lt;id&gt;http://joedev/mftt/_vti_bin/ListData.svc/MyNumbers(6)&lt;/id&gt;
      &lt;title type="text"&gt;&lt;/title&gt;
      &lt;updated&gt;2016-07-08T20:56:13-04:00&lt;/updated&gt;
      &lt;author&gt;
        &lt;name /&gt;
      &lt;/author&gt;
      &lt;link rel="edit" title="MyNumbersItem" href="MyNumbers(6)" /&gt;
      &lt;link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/CreatedBy" type="application/atom+xml;type=entry" title="CreatedBy" href="MyNumbers(6)/CreatedBy" /&gt;
      &lt;link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ModifiedBy" type="application/atom+xml;type=entry" title="ModifiedBy" href="MyNumbers(6)/ModifiedBy" /&gt;
      &lt;link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Attachments" type="application/atom+xml;type=feed" title="Attachments" href="MyNumbers(6)/Attachments" /&gt;
      &lt;category term="Microsoft.SharePoint.DataService.MyNumbersItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /&gt;
      &lt;content type="application/xml"&gt;
        &lt;m:properties&gt;
          &lt;d:ContentTypeID&gt;0x0100913060DC06F4DF458B6A06CA950C1149&lt;/d:ContentTypeID&gt;
          &lt;d:Title m:null="true" /&gt;
          &lt;d:NunberName&gt;One&lt;/d:NunberName&gt;
          &lt;d:Id m:type="Edm.Int32"&gt;6&lt;/d:Id&gt;
          &lt;d:ContentType&gt;Item&lt;/d:ContentType&gt;
          &lt;d:Modified m:type="Edm.DateTime"&gt;2016-07-08T20:56:13&lt;/d:Modified&gt;
          &lt;d:Created m:type="Edm.DateTime"&gt;2016-07-08T20:56:13&lt;/d:Created&gt;
          &lt;d:CreatedById m:type="Edm.Int32"&gt;1&lt;/d:CreatedById&gt;
          &lt;d:ModifiedById m:type="Edm.Int32"&gt;1&lt;/d:ModifiedById&gt;
          &lt;d:Owshiddenversion m:type="Edm.Int32"&gt;1&lt;/d:Owshiddenversion&gt;
          &lt;d:Version&gt;1.0&lt;/d:Version&gt;
          &lt;d:Path&gt;/mftt/Lists/MyNumbers&lt;/d:Path&gt;
        &lt;/m:properties&gt;
      &lt;/content&gt;
    &lt;/entry&gt;
  &lt;/feed&gt;
  </code></pre>
  
  <p>here are my update functions for completeness. </p>
  
  <pre><code>function getListItemById(webUrl, listName, itemId, success, failure) {
      var url = webUrl + "/_vti_bin/Listdata.svc/" + listName + "(" + itemId + ") ";
  
      $.ajax({
          url: url,
          method: "GET",
          headers: { "Accept": "application/json; odata=verbose" },
          success: function (data) {
              success(data.d);
          },
          error: function (data) {
              if (debug == true) {
                  console.log("getListItemById ID:" + itemId);
                  if (data.responseJSON) {
                      console.dir("Data: " + data);
                  }
              }
              if (data.responseJSON) {
                  failure(data.responseJSON.error);
              } else {
                  console.log("getListItemById No data returned for ID: " + itemId);
              }
  
          }
      });
  }
  
  function updateListItem(webUrl, listName, itemId, itemProperties, success, failure) {
      getListItemById(webUrl, listName, itemId, function (item) {
  
          $.ajax({
              type: 'POST',
              url: item.__metadata.uri,
              contentType: 'application/json',
              processData: false,
              headers: {
                  "Accept": "application/json;odata=verbose",
                  "X-HTTP-Method": "MERGE",
                  "If-Match": item.__metadata.etag
              },
              data: Sys.Serialization.JavaScriptSerializer.serialize(itemProperties),
              success: function (data) {
                  success(data);
              },
              error: function (data) {
                  failure(data);
              }
          });
  
      },
      function (error) {
          failure(error);
      });
  
  }
  </code></pre>