I am working on a console application that updates list items using managed CSOM. I have a user or group column in this list that can contain multiple values. Now, I am using below code to update the value of this column:
// Get the user User newUser = web.EnsureUser("LoginName"); context.Load(newUser); context.ExecuteQuery(); FieldUserValue userValue = new FieldUserValue(); userValue.LookupId = newUser.Id; // Update the list item listItem["User"] = userValue;
The issue is if I assign the value of user1 to this column, the value that I see after the column is updated is another user; like user2. I don't know why it is populating this code with some other user?
Any idea on this issue?