0

I don't know how to extract the email of a User in a Sharepoint list. I get a FieldUserValue but I am stuck at it.

Microsoft.SharePoint.Client.ListItemCollection listitems = list.GetItems(query);

            context.Load(listitems);
            context.ExecuteQuery();

            foreach (ListItem item in listitems)
            {
                FieldUserValue fuv = (FieldUserValue)item["MyUser"];

            }
0
Microsoft.SharePoint.Client.ListItemCollection listitems = list.GetItems(query);

context.Load(listitems);
context.ExecuteQuery();

foreach (ListItem item in listitems)
{
   FieldUserValue fuv = (FieldUserValue)item["MyUser"];

   User user = context.Web.EnsureUser(fuv.LookupValue);
   context.Load(user);
   context.ExecuteQuery();

   string email = user.Email;
}

Check this question

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.