Skip to main content

Get Email User Name, email from SharePoint person field in list 

you can get user name and email from person field is the group or person coloumn 
Create PersonGroupCol  - person or group field
If you are not going to use those email address values later (you don't need to save emails in column) and you just want to show the email in SharePoint list view then you can also achieve it using JSON column formatting.
  1. Create one single line of text column (Email, Name)
  2. Hide it from list forms (make it Hidden from content type settings).
  3. Then use below JSON code to format the column:
{
   "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
   "elmType": "div",
   "txtContent": "[$PersonGroupCol.email]"
}
For User Name 
{
   "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
   "elmType": "div",
   "txtContent": "[$PersonGroupCol.title]"
}

 Reference https://sharepoint.stackexchange.com/questions/278295/get-email-from-user-and-enter-into-sharepoint-list-field

other available fields are (not tested)

id
picture
jobTitle
department

Comments

Popular posts from this blog

How to remove special characters from the SharePoint list column using calculated column - SharePoint online

Remove special characters  from the SharePoint list column using calculated column =REPLACE([FirstNameLastName],SEARCH(" & ",[FirstNameLastName]),0,"") or =IF(ISERR(SEARCH("&",Title,1)),Title,REPLACE(Title,SEARCH("&",Title,1),2,""))  Source https://social.technet.microsoft.com/Forums/sharepoint/en-US/42391d83-a6eb-480f-b84a-3d43ef4f5e40/calculated-column-to-remove-amp-and-space-quotamp-quot?forum=sharepointgeneralprevious https://social.technet.microsoft.com/Forums/office/en-US/74d8022b-03f4-4ccf-9bfc-a3075a2f9202/multiple-replace-on-calculated-column?forum=sharepointgeneralprevious
How to display SharePoint list item status values into images/icons using simple JavaScript src="http://code.jquery.com/jquery-latest.min.js" $(document).ready(   function() {     $('td.ms-vb2:contains("Completed"), ' +       'td.ms-vb2:contains("Pending")').each(         function() {           $(this).hide();           $(this).html(ReplaceColorTextWithImage($(this).html()));           $(this).show("slow");         }     );   } ); function ReplaceColorTextWithImage(strColorText) {   var strColorImage = "";   switch(strColorText) {     case "Completed":       strColorImage = "green";       break;     case "Not Started":       strColorImage = "Red";       break;   }  return " " }  ...
LIST OF INTERNAL NAMES FOR SHAREPOINT FIELDS Title InternalName $Resources:RulesUrl $Resources:XomlUrl % Complete About Me Account Action Actual Work Address All Day Event Allow writers to view cached content Anniversary Append-Only Comments Approval Status Approver Comments Article Date Assigned To Assistant’s Name Assistant’s Phone Associated Content Type Associated Service Attachments Author Automatic Update Base Association Guid Billing Information Birthday Body Body Body Was Expanded Business Phone Business Phone 2 Byline Cacheability Callback Number Car Phone Categories Category Category Category Check for Changes Check In Comment Checked out User Children’s Names City Comments Comments Company Company Main Phone Company Phonetic Completed Computer Network Name Connection Type Contact Contact E-Mail Address Contact Name Contact Photo Contact Picture Content Category Content Type Content Type ID Content Type ID C...