I want to insert multiple users to a list field.I have an array,it contains data like below
[{"Login":"i:0#.f|membership|[email protected]","Name":"user1 name","Email":""},{"Login":"i:0#.f|membership|[email protected]","Name":"user2 name","Email":""}]
This data set does not contain user ids.So how I get user Ids for these all users at a time.
I have a code, it's only getting one user at a time. here is my code
var result = Microsoft.SharePoint.Client.Utilities.Utility.ResolvePrincipal(clientContext, clientContext.Web, emailAddress, Microsoft.SharePoint.Client.Utilities.PrincipalType.User, Microsoft.SharePoint.Client.Utilities.PrincipalSource.All, null, true);
clientContext.ExecuteQuery();
if (result != null)
{
var user = clientContext.Web.EnsureUser(result.Value.LoginName);
clientContext.Load(user);
clientContext.ExecuteQuery();
}
Please tell me how to do this