cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sofiaelvira
New Member

Extract emails from person column that allows multiple selection for multiple items

Hi,

 

I am really struggling to get this to work and hoping someone can help me.

 

I have a list of items grouped by (let's say) Customer. Each customer receives a unique ID, and each item belonging to that customer receives a unique ID based on the customer's ID. Example: Customer ID = A2022. Items belonging to that customer, ID = A2022-I01, A2022-I02 etc. I have a person/group column that allows multiple selections. For each item (A2022-I01 etc.) one or more persons can be assigned.

 

What I want to do is to be able to send a single email to all persons connected to a certain customer, i.e. all persons listed in the person/group column, for each item belonging to a specific customer.

 

I have seen many solutions for how to send an email to all persons from a person/group column that allows multiple selections, but those solutions only take into account that you look at one item at a time. When I try to do this for multiple items, the result is a lot of duplicate email addresses (if the same person is assigned to several items for the same customer). In other words, I manage to get email addresses for all relevant persons (via Get items, filtered for starting with the customer ID), but I can't find any way to combine these into one string where there are no duplicates. The flow I created is a manually triggered flow, if that matters.

 

Greatful for any tips and pointers. Let me know if you need more info.

 

BR,

Sofia

5 REPLIES 5
okeks
Super User
Super User

Thank you. Unfortunately, this doesn't work for the my problem, seeing as I want to join email addresses from multiple items which each has multiple persons' email addresses. In other words, I have to find some way to merge the arrays I get for each item and then remove duplicates.

v-bofeng-msft
Community Support
Community Support

Hi @sofiaelvira ,

 

Do you want to combine the person fields that allow multiple selection in a table and get the email address strings separated by ; after deduplication?

 

If so , I've made a test for your reference:

1\My SP list:

vbofengmsft_0-1651730515202.png

2\My flow:

vbofengmsft_1-1651730551051.png

vbofengmsft_2-1651730622225.png

The Result:

vbofengmsft_3-1651730674458.png

Best Regards,

Bof

 

 

 

Hi,

Thank you for the reply, that sounds about right! However, when I try this, I receive the error message that the action Select failed because the input was 'null'. It makes sense, since the input is from Compose, which in turn has input from the Email variable, which is empty from the start (no initial value added). Maybe I'm missing something?

BR,

Sofia

VictorIvanidze
Community Champion
Community Champion

Please show where you get the error.

--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (6,159)