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

Printing Date Format in  Power Automate (Flows) I was trying to format print the date and found multiple ways to print Date perticularly Month for my requirements. please find various  Month Format  formatDateTime(triggerBody()?['Test_x0020_Date_x002F_Time'],'MM/dd/yyyy') Output 12 /11/2020  formatDateTime(triggerBody()?['Test_x0020_Date_x002F_Time'],'MMM/dd/yyyy')   Output  Dec /11/2020  formatDateTime(triggerBody()?['Test_x0020_Date_x002F_Time'],'MMM/dd/yyyy') Output    December /11/2020  Surce https://sharepains.com/2018/11/12/formatdatetime-flow-power-automate/     The formatting options for formatDateTime, that you can use here are listed in the following table. Any of the format specifiers can be used in any kind of combination. FORMAT SPECIFIER DESCRIPTION EXAMPLES “d” The day of the month, from 1 through 31. More information:  The “d” Custom Format Specifier . 2009-06-01T13:45:30 -> 1 2009-06-15T13:45:30 -...
How Search or get the documents in subfolders of Document library in SharePoint Option 1  Using CAML Query below CAML query used to filter                     Sites /SiteCollectionName/SubsiteName/DocumentLibraryName/Folder Name/SubFolderName/SubSubFolderName/SubSubSubFolderName       Source https://sharepoint.stackexchange.com/questions/60495/caml-query-for-sub-folder-documents-javascript https://sharepoint.stackexchange.com/questions/59216/get-all-files-from-sub-folder-of-a-certain-content-type https://sharepoint.stackexchange.com/questions/215230/get-all-items-in-list-by-field-name-caml-query Option 2 Create a View which can point to SubFolder by changing the filter for the view using SharePoint Designer Source:  https://www.tombenjamin.ca/blog/designer/view/using-caml-query-show-files-folder/ There is a thread on  social.technet  where someone asks how to “Create a we...