SOLVED

Extract email from people picker in another column

Copper Contributor

Hello, I have two columns in a SPO list. One has a people picker for the data type and the other is a text column. I am trying to autoupdate the text column with the email address of the person selected from the people picker column. Is this possible without the use of Power Apps form customization?

7 Replies
I haven't got the answer to hand, but PowerAutomate will be able to solve this without form customisation. If you are hoping to solve this purely within Sharepoint list functionality, I don't think you'll find a solution.

@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]"
}

 

Outputemail from people field.png

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.

@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.

 

RADical6142_0-1655744981602.png

 

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'.'
 

 

@RADical6142 

 

If I got you right you want to populate the e-mail address of the selected person from the people picker column into an additional field, to make use of it within a different Flow.

A People Picker column is a so-called complex field, which consists of multiple attributes.
One is the e-mail address already, thus you can make use of it directly without any further steps.

Anyhow I would suggest to check for the validity of the selected person always, as any People Picker selection does not get verified regular once added and accounts tend to get disabled over time.

A potential way could be the following example (my people picker column is simply named 'Person').
I check for the user profile by removing the pre-fix of the Claims from the people picker, which returns the accounts UserPrincipalName.
Then two parallel actions, one has a  'configure run after' defined from within the three dots to run only if the action 'Get user profile (V2)' has failed, means it could not find the user in question from the people picker column.

Micca0815_0-1655801110901.png

 

As you might not want your Flow to do certain things each time a record is updated randomly, you could either accept a Flow run and set a condition to be checked for at the beginning or skip the Flow run by specifying additional trigger conditions.
https://tomriha.com/a-simple-way-to-create-a-trigger-condition-in-power-automate/ 

best response confirmed by RADical6142 (Copper Contributor)
Solution

@Micca0815 

I tried the solution, but it kept giving me an error. I ended up trying a few different solutions and this worked for me.

 

RADical6142_0-1656618168072.png

 

Thanks!

 

I 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.

@aasthas121294 Use this: 

 

"txtContent": "[$PersonGroupCol.title]"

 


Please consider giving Like if my post helped you in any way.

1 best response

Accepted Solutions
best response confirmed by RADical6142 (Copper Contributor)
Solution

@Micca0815 

I tried the solution, but it kept giving me an error. I ended up trying a few different solutions and this worked for me.

 

RADical6142_0-1656618168072.png

 

Thanks!

 

View solution in original post