I have a Sharepoint list called AproverList where ApproverName2 field is "Person or Group" type with multiple selection option
This is the code I'm using, but it allows me to enter only one user into the field ApproverName2. Do you know how to achieve the insertion of multiple users into this multi selection field?
using (ClientContext clientContext = TokenHelper.GetClientContextWithAccessToken(siteUri.ToString(), accessToken))
{
Web web = clientContext.Web;
try
{
List targetList = web.Lists.GetByTitle("ApproverList");
ListItemCreationInformation itemCreateInfo = new ListItemCreationInformation();
ListItem newListItem = targetList.AddItem(itemCreateInfo);
newListItem["ApproverId"] = "1";
newListItem["Title"] = "GBO";
newListItem["ApproverName2"] = web.EnsureUser("jsamakm");
newListItem.Update();
clientContext.Load(newListItem);
clientContext.ExecuteQuery();
}
catch (Exception ex)
{
}
}