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.

View solution in original post

greenkg24
Regular Visitor

That worked, thank you so much!! 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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