I am trying to add multiple people to a SP column of type Person/Group i.e. people picker. I am able to add one successfully using their userId, but HAVE no clue how to do that for multiple people. Here is the code for one user:
function UserDrop(e, toElement, listGuid, columnName) { //EcmaScript Client Object Model var ctx = new SP.ClientContext.get_current(); var list = ctx.get_web().get_lists().getById(listGuid); var item = list.getItemById(elementId); //columnName is of type person/group and I am adding user //whose userId is 7 item.set_item(columnName, 7); item.update(); // asynchronous call ctx.executeQueryAsync( function () { toElement.innerHTML = userLinkHtml; }, function () {alert ("Error")} ); return false; }
This works great and I can add user whose userId is 7, however I want to add multiple people like let's say users of user Ids 7 and 8.
Any ideas or help will be greatly appreciated.
There is a thread on this one but that's from .net COM which could accessed here: http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010general/thread/5183e87c-ee1d-4594-9492-0dfdf6616cce
7929