Forum Discussion
Extract email from people picker in another column
- Jun 30, 2022
I tried the solution, but it kept giving me an error. I ended up trying a few different solutions and this worked for me.
Thanks!
RADical6142 Do you just want to show the email in list view or store the value in column & use it somewhere else?
If you just want "display" value in list view, you can use JSON formatting on column like:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"txtContent": "[$PersonGroupCol.email]"
}
Output:
If you want to store the value in column & use it somewhere else, you can create a power automate flow to update the Email address field based on the Person or Group field.
Check my answer given in this thread where I have explained same scenario in detail: 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.
- aasthas121294Aug 31, 2022Copper ContributorI just needed this. Thanks alot. But I am looking for one more thing. For email, we have .email but what if I want to extract display name of the user? I am trying to use "txtContent": "[$PersonGroupCol.displayName]" but it is not working.
- ganeshsanapAug 31, 2022MVP
aasthas121294 Use this:
"txtContent": "[$PersonGroupCol.title]"
Please consider giving Like if my post helped you in any way.
- RADical6142Jun 20, 2022Copper Contributor
ganeshsanapThank you for your reply.
I need to use the email address field in a flow, so option 1 probably wouldn't be ideal.
I tried option 2 from the article you mentioned, but the flow fails every time it runs.
The API 'sharepointonline' returned an invalid response for workflow operation 'When_an_item_is_created' of type 'OpenApiConnection'. Error details: 'The API operation 'GetOnNewItems' is missing required property 'body/value/0/Title'.'