0

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?

2

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.

  1. Create one single line of text column.
  2. Hide it from list forms (make it Hidden from content type settings).
  3. 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:

enter image description here

| improve this answer | |
  • Solution 2 was a really clever approach! Just wondering why you are hiding the column? – Rune Sperre Mar 31 at 11:58
  • If you don't want to enter it manually fro list form then you probably wants to hide it from list forms. if you are okay with field being visible on forms then keep it that way. – Ganesh Sanap Mar 31 at 12:16
  • Also, keep in mind that by using 2nd approach we are just showing the email in list view. not actually saving the values in list column (email column). – Ganesh Sanap Mar 31 at 12:17
  • 1
    Ah yes of course, I should have read it again. I though you were hiding it from the list view... – Rune Sperre Mar 31 at 12:28
  • Hi @Mirte, does this answers your question? If Yes, Please Upvote and accept it as an answer if it helped you. – Ganesh Sanap Apr 1 at 17:55
0

In addition to Ganesh Sanap’s Solution 1, here’s a sample flow for your reference.

enter image description here

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.

| improve this answer | |
  • Thanks, i tried solution 1 with the flow and it works! I will try solution 2 also, just for practice. I also tried the trigger, When a item is selected. However, that does not work. I have over a 100 items that need to be updated with the emailadresses. So, is there a way around making an manual change to all the items first? – Mirte Apr 1 at 17:26
  • @Mirte Solution 2 is the better one actually since it updates the column in time – as soon as you fill in/modify the person or group column. If you want to bulk update item properties, you may consider using PowerShell: sharepointdiary.com/2015/07/… – Chelsea_MSFT Apr 2 at 5:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.