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 all reci...
Power Apps
Answered

Send email to all recipients listed in gallery

(0) ShareShare
ReportReport
Posted on by 421

Hi everyone.  I am trying to send an email from powerapps to all recipients listed in a gallery.  The code below works if I am choosing a single line, but not sure how to add in all members of the gallery.

 

Office365Outlook.SendEmailV2(Gallery25.Selected.UserEmailCapture,"Subject","Body")

 

I can make the gallery items a collection if that solves the issue as well.

 

Thanks in advance!

 

Chris

Categories:
I have the same question (0)
  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @ckserra33,

     

    If you want to mail all people listed within the Gallery control and the gallery data source contains an email field, you can use the Concat() function to achieve this:

     

     

    Concat(GalleryName.AllItems, EmailFieldName, ";")

     

    Change the galleryName and EmailFieldName to your specific case.

     

    You can use this directly in the 'to' field (of the Office365Outlook.SendEmailV2 function) or set it as a variable and use that as the to field instead.

    You also don't need to use the GalleryName.AllItems, you can reference your Data Source (or collection) directly.

     

    If this solves your question, would you be so kind as to accept it as a solution.

    Thanks!

  • ckserra33 Profile Picture
    421 on at

    @LaurensM Perfect!  Thank you very much!!

  • bcmoyer16 Profile Picture
    2 on at

    Is there a way that one could send an email to all users in a gallery that has been filtered by certain criteria? I'd like to send an email to all users with entries in a gallery from only the previous month, if that makes sense.

  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @bcmoyer16,

     

    The code would be the same as was written above, because you already filter the Gallery.AllItems.

    .AllItems only refers to the items shown within the gallery, not the items that are in the datasource connected to that gallery - if this makes sense.

     

    You can also filter on the displayed gallery items should this be needed: 

    Concat(
     Filter(
     GalleryName.AllItems, 
     Month(CreatedFieldName) = Month(Now()) - 1
     ), 
     EmailFieldName, 
     ";"
    )

    What I would suggest is creating a new, separate topic for your question with some context and Code snippets or screenshots.

     

    I hope this helps!

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello! 
    I am trying to use your idea for a workflow in power apps but it's not working. Maybe do you have any idea?

     

    Genehmigungdeslaufwerke.Run(Concat(Gallery6_1.AllItems;Body);User().Email;PlainText(HtmlText1.HtmlText);HtmlTextApprove.HtmlText;HtmlTextNotApprove.HtmlText);;

     

    my error is exactly in " (Concat(Gallery6_1.AllItems;Body) "

    DNRM_0-1692272425639.png

     

    best regards 😄 

     

  • dlwalla Profile Picture
    4 on at

    Power Apps is saying that 'EmailFieldName' is expecting a text value

  • karolina1406 Profile Picture
    9 on at

    This is perfect! Thank you... Can this also be done to create Distinct list of the values? I am using Distinct(Concat(colNotifiers,Email,";" & Char(10))) but it doesn't work 😞

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 534

#2
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard