“Is there a way in Power Automate to split emails from a multiple people picker field to have a single email per user for all of the items in which they are included as an owner?”
Following a question from the original article to Send one email per user with multiple SharePoint items, what if the column is not a single people picker? What if the column allows selection of multiple users? If you have more than 1 user assigned per item? You probably still want to send only one email per user, even if they share the item with others.
Get user emails from the items
Once you switch the people picker column to multiple selection, its structure will change. It won’t be an object with the user anymore, now it’ll be an array of objects (=users). And as such you can’t get the email addresses as easily using a single ‘Select’ action. You’ll need more of them and one loop.
Start with the first ‘Select’ and select all the approvers from all the items.
The result will be an array of arrays – for each request you’ll get all the approvers. Here comes the need for a loop. Continue with ‘Apply to each’ where you loop through the output, processing the approvers for each item one by one.
That’s how you remove the first array, by looping through. Each item in this loop will now contain only the object with approvers, where you can ‘Select’ their emails as many times before. Don’t forget that you must reference the previous action, not the ‘Get items’!
From: item() Map: item()?['Email']
This second ‘Select’ will give you an array of email addresses for users assigned to the task. Turn them into a string with the join(…) expression in a ‘Compose’ action.
Use another ‘Compose’ after the loop to join all the email addresses for all the requests into a single string. Then split it to convert it into an array with each email being a single item.
At the end of the loop you’ll have a ‘Compose’ action that’ll contain all the email addresses as separate items. Process it with the union(…) expression to keep only the unique values = unique emails.
Filter the items for each user
The other difference from the original flow is in the ‘Filter array’ action. As already said, the people picker column in each item will contain an array of users. Therefore, you can’t simply filter by the user email. You must check the whole array of objects if one of them contains the email address. The easiest way is to convert the array into a string with the string(…) expression, which will allow you to use the ‘contains’ operator.
From that point on you can continue with the original flow – build an HTML table and send the email.
Once you switch from the single user to multiple people picker in SharePoint items, the Power Automate flows get more complicated. You don’t have a single object where you can easily access the email, you’ll get an array. And since it’s an array, you’ll have to loop through all the items, and for each item loop through the users. Once you’ve got them in a variable it’s easy to remove duplicates and filter the items with the little string(…) workaround.