Send Email Notification with Power Automate based on SharePoint List Multi-Select Person Field

Power Automate, Microsoft 36507/05/2022

Many automations with Power Automate are based on SharePoint lists. Some of them are used to collect, analyze data and send notifications. This is where most of the requests come to send notifications by mail to specific users. This brings us directly to the topic of sending messages via Outlook Connector based on a person (with multiselect) field within the SharePoint list.

SharePoint List Multiselect
SharePoint List Multiselect

If we simply set a mail to the people, person (multi-select) field via Power Automate Flow, unfortunately this does not work, because the Outlook Connector does not support it, and only expects email addresses with semicolon separated notation.

To realize this, some intermediate steps are necessary by selecting the email addresses from the Person (multiselect) Field and formatting them for sending mail notifications.

  1. Let's go to the first step. We create a Power Automate Flow with the desired trigger for example run 1 time per day and initialize an array variable. Furthermore we create the action "Get Items" on our SharePoint list.
Power Automate 1
Power Automate 1
  1. If we run the flow and have a look at the ouput, our "Responsible" field will look like the picture below. In the following steps we will access and format the "Email" information.
{
  "Responsible": [
    {
      "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
      "Claims": "i:0#.f|membership|meganb@m365x515065.onmicrosoft.com",
      "DisplayName": "Megan Bowen",
      "Email": "MeganB@M365x515065.OnMicrosoft.com",
      "Picture": "https://m365x515065.sharepoint.com/sites/TestTeam2147/_layouts/15/UserPhoto.aspx?Size=L&AccountName=MeganB@M365x515065.OnMicrosoft.com",
      "Department": "Marketing",
      "JobTitle": "Marketing Manager"
    },
    {
      "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
      "Claims": "i:0#.f|membership|alexw@m365x515065.onmicrosoft.com",
      "DisplayName": "Alex Wilber",
      "Email": "AlexW@M365x515065.OnMicrosoft.com",
      "Picture": "https://m365x515065.sharepoint.com/sites/TestTeam2147/_layouts/15/UserPhoto.aspx?Size=L&AccountName=AlexW@M365x515065.OnMicrosoft.com",
      "Department": "Marketing",
      "JobTitle": "Marketing Assistant"
    }
  ]
}
  1. In the next step we will set the predefined variable "Mails" to the Responsible field and have an array variable with our Resonsible users.
Power Automate 2
Power Automate 2
  1. In the next step a "Select Operator" is created. Within the Select Operator in field "From" the previously set array variable is used and within "Map" 'SwitchMode' is changed and the following expression Item()['Email'] is added to access the email addresses of the users.
Power Automate 3
Power Automate 3
  1. In the last step the email addresses have to be formatted correctly so Outlook can use them, therefore it is necessary to convert the values separated by ";". For this a join operator is used. 'From' is the output of the select action and 'Join with' is defined as the separator ";"
Power Automate 4
Power Automate 4

The formatting of the email addresses is complete and now can be used for the Outlook connector, for example to inform users about the status of SharePoint list items.

Power Automate 5
Power Automate 5