Forum Discussion
Automatically fill a single text column in Lists by the value of a Person Field column
- Jun 13, 2023
Femke11 If you just want to show the email address in the list view, you can easily do it using JSON formatting like:
{ "$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. You can get the internal name of your person or group column by following this article: How to find the Internal name of columns in SharePoint Online?
You can read more information about this approach in my answer given at: Get Email from user and enter into SharePoint list field
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.
Femke11 If you just want to show the email address in the list view, you can easily do it using JSON formatting like:
{
"$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. You can get the internal name of your person or group column by following this article: How to find the Internal name of columns in SharePoint Online?
You can read more information about this approach in my answer given at: Get Email from user and enter into SharePoint list field
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.
Wow, this works much faster! Thank you so much!!
I've tried to do the same with the name of the person (because I cannot use a Person Field column as a Lookup in another List) and therefore I've tried the same JSON formatting (I used "[$PersonGroupCol.name]" and "[$PersonGroupCol.displayname]" instead of "[$PersonGroupCol.email]") - but that doesn't work :-). I cannot seem to find a list of names. Do you happen to know that as well?
- ganeshsanapJun 14, 2023MVP
Femke11 The people fields in JSON formatting supports 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" }
You can get the name of users using the title proeprty.
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.
- Femke11Jun 13, 2023Copper ContributorFound it!
With 'title' it works 👍
"[$PersonGroupCol.title]"