Get Email from user and enter into SharePoint list field
-
08-02-2021 - |
Question
I have a SharePoint list where I use a field Person or Group to enter an Employee's name.
The second column is their email address which I enter manually. Is it possible to fill this field automatically with their email address and how?
Solution
Solution 1:
You can create a workflow or Microsoft flow/power automate to update the Email address field based on the Person or Group field.
Solution 2:
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:
OTHER TIPS
In addition to Ganesh Sanap’s Solution 1, here’s a sample flow for your reference.
There is one dynamic content called PersonGroupCol Email
, which you can directly use to update the Email column. (Where PersonGroupCol
is internal name of person or group field.)
Not as good as the Solution 2 but it is doable.