Monday, August 5, 2019

Get the mail address from a FieldUserValue OR CreatedBy OR Author in CSOM

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

http://crawlspaceofprogramming.blogspot.com/2015/08/get-mail-address-from-fielduservalue.html?_sm_au_=iVVVTVW7sq4PQnWM


USING Powershell

https://www.sharepointdiary.com/2016/05/powershell-to-get-created-by-user-field-values-in-sharepoint.html




No comments:

Post a Comment

Building Secure Azure AI Foundry Agents with Managed Identity

  The credential problem nobody wants to own Every team that connects an Azure AI Foundry agent to Microsoft Graph, SharePoint, Outlook, or...