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.
- StefudemOct 10, 2023Copper Contributorganeshsanap Thank you for this solution which works really well. I would like to know what other information can be retrieved this way? By replacing column.email. I would also like to retrieve the user's login in addition to their email address.
- ganeshsanapOct 11, 2023MVP
You can get following properties from person column using SharePoint JSON formatting. The people field object has the following properties (with example values):
{ "id": "122", "title": "Kalya Tucker", "email": "email address removed for privacy reasons", "sip": "email address removed for privacy reasons", "picture": "https://contoso.sharepoint.com/kaylat_contoso_com_MThumb.jpg?t=63576928822", "department":"Human Resources", "jobTitle":"HR Manager" }
Please consider giving a Like if my post helped you in any way.
- cdfjdkJun 21, 2023Copper Contributor
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.
- JamesPhImpOct 27, 2022Copper Contributor
ganeshsanap Thank you, I was hoping there was a simpler way - but I set up a flow.