cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
greenkg24
Regular Visitor

Combine mutli select person/group column and their respective emails into "TO:" line to send one email to many

I have an app that shows a gallery of records, I also have a form viewer that shows information related to the currently selected item in the gallery. Each record contains a person/group field that allows users to add one or more people to the field. 

 

I have added another screen that takes the currently selected item and attempts to copy and paste a few fields, one being the person/group field, into an email message that would allow the user to send an email to the people designated for the selected record. 

 

The trouble I'm running into is I cannot for the life of me get the email to send to all people listed. I can get it to work when only one person is selected, but not when there are multiple. 

 

The items attribute for the field containing the person/group data is:

 

 

Choices([@'list name'].columnname)

 

 

Which works fine as it is in the form viewer, DisplayMode.View. This is the field that I'm trying to copy and paste the emails of the people listed into the "TO" line of the email screen. 

 

Here is what I have so far in the OnSelect attribute of the "Send" button for the email screen:

 

 

Office365Outlook.SendEmailV2(DataCardValue19_6.Selected.Email, TextInput1_1, TextInput1_2);Navigate(Confirmation, Fade);

 

 

 

This works everytime, but only sends the email for the last person select. I've tried concat and concatenate but I've only got it to copy and concatenate on the last person. 

 

The "DataCardValue19_6" in the formula above is referencing a form viewer in edit mode. The items attribute of the combo box I'm using as the "TO" line is:

 

 

Choices([@'list name'].columnname).Email

 

 

which populates the combo box as seen below in the screen shot. 

greenkg24_0-1634497756777.png

 

Any help is much appreciated!!

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @greenkg24 ,

Try this

Office365Outlook.SendEmailV2(
   Concat(
      DataCardValue19_6.SelectedItems,
      Email & ";"
   ),
   TextInput1_1, 
   TextInput1_2
);
Navigate(Confirmation, Fade);

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

2 REPLIES 2
WarrenBelz
Super User
Super User

Hi @greenkg24 ,

Try this

Office365Outlook.SendEmailV2(
   Concat(
      DataCardValue19_6.SelectedItems,
      Email & ";"
   ),
   TextInput1_1, 
   TextInput1_2
);
Navigate(Confirmation, Fade);

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

greenkg24
Regular Visitor

That worked, thank you so much!! 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (2,072)