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"];

            }
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

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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