Forum Discussion
Display email from a person column
- Oct 26, 2022
Solution 1:
You can create a power automate flow on item creation/item update to update the Email address field based on the Person or Group field.
Solution 2: Customize list forms using Power apps and set default value of email address field based on the Person or Group field.
Solution 3: 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.
- Create one single line of text column.
- Hide it from list forms (make it Hidden from content type settings).
- 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]" }
Where PersonGroupCol is internal name of person or group field.
Output:
Similar thread: Get Email from user and enter into SharePoint list field
Related read: How to find the Internal name of columns in SharePoint Online?
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
Solution 1:
You can create a power automate flow on item creation/item update to update the Email address field based on the Person or Group field.
Solution 2: Customize list forms using Power apps and set default value of email address field based on the Person or Group field.
Solution 3: 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.
- Create one single line of text column.
- Hide it from list forms (make it Hidden from content type settings).
- 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]"
}
Where PersonGroupCol is internal name of person or group field.
Output:
Similar thread: Get Email from user and enter into SharePoint list field
Related read: How to find the Internal name of columns in SharePoint Online?
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
This works very nicely, thank you! But it is not possible to concatenate these columns. Is it possible to somehow wrap the returned email address as text to support concatenation?
- ashukla2023Sep 19, 2023Copper ContributorHi, I also have multiple users in a column wanted to copy all emails out of the column but SharePoint modern list view is not allowing me to copy form listing page, and on detail page is is showing as person as soon as I click to copy, any suggestions please?
- ganeshsanapJun 21, 2023MVP
cdfjdk Are you using person or group column with multiple selection allowed?
If yes, you can use join operator to concatenate email addresses. Use JSON like:
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "txtContent": "='Emails: ' + join([$Name.email], '; ')" }
Please consider giving a Like if my post helped you in any way.
- cdfjdkJun 21, 2023Copper Contributor
Thanks ganeshsanap - I think I have been unclear. I want to concatenate columns. I have different columns of persons and their email addresses, but I also need to combine these persons and their email addresses in groups. So that means one column that concatenates several Person or Group columns and one column that concatenates several email columns. SharePoint won't do that. But maybe if the columns can be formatted as text I can get SharePoint to concatenate them.
- ganeshsanapJun 22, 2023MVP
cdfjdk You can combine person columns and text columns with email addresses as well using SharePoint JSON formatting.
Example:
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "txtContent": "='Emails: ' + [$Person1.email] + '; ' + [$Person2.email] + '; ' + [$TextEmail1] + '; ' + [$TextEmail2]" }
Output:
Make sure you are using correct internal names of your SharePoint list columns.
Please consider giving a Like if my post helped you in any way.