web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Send email to several ...
Power Apps
Answered

Send email to several selected people

(0) ShareShare
ReportReport
Posted on by 58

Hello everyone,
I would like to send an email to people who are listed in a gallery. Each value in the Gallery has a checkbox. For this I used the following formula:

 

ForAll(Filter(Gallery4.AllItems;Checkbox5.Value=true);Office365Outlook.SendEmailV2(Gallery4.Selected.Value;TextInput6.Text;RichTextEditor1.HtmlText));;Reset(TextInput6);;Reset(RichTextEditor1);;UpdateContext({ResetCheckbox:true});;UpdateContext({ResetCheckbox:false})

 

If I select a person, that works great too. However, if I select multiple people, then it always takes the person who was selected last. But I would like to send the email to all selected people. How do I get that?

 

Thank you in advance!

 

 

Categories:
I have the same question (0)
  • PowerNovice Profile Picture
    on at

    Have you tried a PowerAutomate flow to do this? Thats where i would start rather than trying to do it through PowerApps itself. Im not sure how you would pass the emails to powerautomate though, maybe you would have to store them in a temp excel file, and that powerautomate looks at that excel file or sharepoint list takes the emails and passes it in and then at the end of automation script, it clears the sharepoint list/excel file and is ready for the next set of info being passed. 

     

    I suggest PowerAutomate because i use it to send emails for me, however, the recipient email isn't variable, its fixed. 

     

    This isnt an answer to your question, it is just me providing an idea that i think could work. Im not the best at PowerApps or PowerAutomate, might b e worth making a post on the PowerAutomate pages as well. 

  • BCLS776 Profile Picture
    8,994 Moderator on at

    Try:

    ForAll(
     Filter(Gallery4.AllItems;Checkbox5.Value=true) As aItem;
     Office365Outlook.SendEmailV2(
     aItem.Value;
     TextInput6.Text;
     RichTextEditor1.HtmlText
     )
    );;
    Reset(TextInput6);;
    Reset(RichTextEditor1);;
    UpdateContext({ResetCheckbox:true});;
    UpdateContext({ResetCheckbox:false})

    Hope that helps,

    Bryan

  • mmbr1606 Profile Picture
    14,629 Super User 2026 Season 1 on at

    try this:

     

    ForAll(
     Filter(Gallery4.AllItems, Checkbox5.Value = true),
     Office365Outlook.SendEmailV2(ThisRecord.Email, TextInput6.Text, RichTextEditor1.HtmlText)
    );
    Reset(TextInput6);
    Reset(RichTextEditor1);
    UpdateContext({ResetCheckbox: true});
    UpdateContext({ResetCheckbox: false})

     

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

  • Masakichi123 Profile Picture
    58 on at

    Hello @BCLS776 

     

    that worked, thanks! One more question:
    If you now tick individual boxes, the email will be sent to these people correctly. I now wanted to provide a button in the form of a hook with which you can click all the checkboxes at once. To do this I use the following formula:

    OnSelect= Set(varCheck;true) 

     

    Unfortunately, if this route is chosen, the same error as before occurs again. What do I have to do to fix this?

    Thank you in advance!

     

  • Verified answer
    BCLS776 Profile Picture
    8,994 Moderator on at

    You can do them all with this small adjustment to the code:

    ForAll(
     Filter(Gallery4.AllItems, Checkbox5.Value = true || varCheck),
     Office365Outlook.SendEmailV2(ThisRecord.Email, TextInput6.Text, RichTextEditor1.HtmlText)
    );
    Reset(TextInput6);
    Reset(RichTextEditor1);
    UpdateContext({ResetCheckbox: true});
    UpdateContext({ResetCheckbox: false})

    Bryan

  • Masakichi123 Profile Picture
    58 on at

    Thanks a lot! 🙂 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,070

#2
Valantis Profile Picture

Valantis 639

#3
11manish Profile Picture

11manish 608

Last 30 days Overall leaderboard