Code to get user Email from SharePoint ListItem - Created By
//var Author = fieldVals["Author"];
FieldUserValue Author = (FieldUserValue)item["Author"];var user = postPageCtx.Web.EnsureUser(Author.LookupValue);
// load the data with the context
postPageCtx.Load(user);
postPageCtx.ExecuteQuery();
var createdBy = user.Email;
Reference Links:
Get the mail address from a FieldUserValue Client Side vs Server Side
USING Powershell
https://www.sharepointdiary.com/2016/05/powershell-to-get-created-by-user-field-values-in-sharepoint.html
No comments:
Post a Comment