Quite a common requirements for Microsoft Flow is to use a multi-people field to create a single event in a calendar or a single email.

The poor way

Table of Contents

You will probably start by creating a SharePoint list with a people field that can hold multiple people.

Then you create a flow that triggers on the creation of an item in this list. Then you add a create event action in the Flow and  you end up with a flow like this:

SharePoint's multi-people fields in Power Automate Microsoft Flow, Microsoft Office 365 applytoeachevent

That’s not nice. Flow has now added a Apply to each step. this then results into multiple events being created.

How do we solve this one?

I’m starting this by initialising 3 variables.

SharePoint's multi-people fields in Power Automate Microsoft Flow, Microsoft Office 365 initializevariables

Now I’m setting 3 variables :

  • Attendee – is a copy of my email field. Although not really needed it does help when you debug the flow to have this available within the run history output
  • Attendees – The list of attendees that the flow is building up. this will be used for the create event action
  • Previous Attendees – This is a variable to store the values in temporarily as the set variablee doesn’t like to use the same variable to set and to reference within its new  value.

Again an Apply to each will appear, but this time I’m happy with that as I can now concatenate the attendees into a single string. It would be nice to just use 2 variables but it isn’t possible to assign a value to a variable using the value of the variable itself.

SharePoint's multi-people fields in Power Automate Microsoft Flow, Microsoft Office 365 buildattendeeslist

The concat function looks like this

concat(variables(‘Previous Attendees’),’;’,items(‘Apply_to_each’)?[‘Email’])
or
concat(variables(‘Previous Attendees’),’;’,variables(‘Attendee’))

Then finally I adjust the required attendees in my event by using by attendees variable and all works as I wanted:

SharePoint's multi-people fields in Power Automate Microsoft Flow, Microsoft Office 365 createevent

The better way

To create a semicolon separated list of email addresses from a people field you can also follow a better pattern.

First use a Seelct action and feed it with the People field in your SharePoint list.

Then use a compose action and set this to:

join(body('Select'),';')

You will now have a flow that looks like this:

SharePoint's multi-people fields in Power Automate Microsoft Flow, Microsoft Office 365 image 45
Avatar for Pieter Veenstra

By Pieter Veenstra

Business Applications Microsoft MVP working as the Head of Power Platform at Vantage 365. You can contact me using contact@sharepains.com

15 thoughts on “SharePoint’s multi-people fields in Power Automate”
  1. Hi Pieter, I’m curios – why did you create 3 variables ? I updated mine with 1 variable, and eventually solved my issue

    1. Hi Priscilla,

      You probably could do things with one variable by using more complex expressions. I try a however to put the complexity in the actions rather than the expressions. How did you set your variable?

      1. Hi,

        I just created a string variable: “Attendees”
        – composed the function: concat(item()?[‘Email’],’;’,variables(‘Attendees’))
        – Set the variable to the compose output.

  2. I solved this by doing the following:

    1.) Initialize an array variable called “Notify List Array”
    2.) Initialize a string variable called “Notify List Emails”
    3.) Apply-to-each and use the “Append to array variable” action
    -Name: “Notify List Array”
    -Value: insert dynamic content for your multi people list
    4.) Use a Join Array action:
    – From: Notify List Array
    – Join with a semicolon ;
    5.) Set Variable Notify List Email = Output from the join array action

    Now you can use the variable in a send email action. 🙂

  3. This is for email field. How would it work if I have multiple people picker selections as display name, I am not able to make it work. I have a people picker column in a task list which allows tagging multiple users, it shows display name.

    1. Hi Cindy and Devang (Sorry I missed your comment),

      I created a multi people field and called this People.

      People Array in Compose action

      I can now refer to this People array using output(‘Compose’)?[‘People’] The Email address of the people selected can be found in the Email property within the array.

  4. Hi there, and thank you very much for your post.

    I’m the administrator for a SharePoint document library, and whenever a new document is uploaded an email needs to be triggered to multiple recipients. The solution that works best is your original solution where 3 variables are set, however for some reason I am receiving every email in duplicate and I don’t know why. I am uploading the documents, so not sure if that has anything to do with it. The recipients are all just getting one email, addressed to all recipients – which is the goal I’m trying to achieve.

    I’m afraid I’m not an advanced Power Automate user, so I failed to apply the alternative solutions suggested by Priscilla and Crockerfeller.

  5. I tried following ‘the better way’ here. However, I’m not clear on the map used in the select. If i try and put the dynamic reference to the email in the field in here (as it looks like in the screen grab) it automatically creates a for loop as it is looking at the array of email addresses. What should the map be?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from SharePains by Microsoft MVP Pieter Veenstra

Subscribe now to keep reading and get access to the full archive.

Continue reading