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 / SHOWING EMAILS ON POWE...
Power Apps
Answered

SHOWING EMAILS ON POWERAPPS AND SENDING A PERSONALIZED MESSAGE

(0) ShareShare
ReportReport
Posted on by

Hey guys, I want to show all the emails available in a powerapps gallery and inside it, send a specific email to one or more, is it possible?

 

My gallery:

 

gest all mails on powerapps canvas.png

Categories:
  • UdayAdhikari Profile Picture
    450 Most Valuable Professional on at

    Hi @Gorilla_8, first nice nick name :). Alright, if you are looking to get all emails available in your tenant/exchange in a gallery, then you can get by use below expression in Items property of your gallery and drop a label control and set it's Text property to "ThisItem.Mail". This will display all email addresses available in your tenant in the gallery.

    Microsoft365Users.SearchUser({searchTerm:""})

     

    As for sending emails, you have 2 options: send from within Power Apps or call a Power Automate to flow the email by passing necessary values. I am guessing you have it covered otherwise just reply back with you requirements and I will see how I can assist.

     

    Note: Microsoft365Users is a connector name for Office365Users.

     

    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.

  • Gorilla_8 Profile Picture
    on at

    Hi @UdayAdhikari , HAHAHA, Thank you for your attention on my nick name! 😄

     

    The function you informed me worked perfectly, but would there be any way to just select a corresponding email type?

     

    Or do a dynamic filter in this gallery?

     

    --------------------------------------------------------------------------------

     

    For example:

    I have users with "@ gmail.com" and users with "@ outlook.com" and other users with "@ yahoo.com", is this possible?

  • UdayAdhikari Profile Picture
    450 Most Valuable Professional on at

    @Gorilla_8 - lol, it was hard to miss and I was not sure if I really wanted to mess with Gorilla 🙂

     

    I think filter is your best option. I could not find a way to filter in the initial load but you could do this:

     

    On app start or page visible add below code:

    ClearCollect(
     colMailDomains,
     {DomainName: "outlook.com"},
     {DomainName: "gmail.com"}
    );
    
    ClearCollect(
     colAllEmails,
     Microsoft365Users.SearchUser({searchTerm: ""})
    );

     

    And add below code to Gallery > Items control

    Search(
     colAllEmails,
     First(colMailDomains.DomainName).DomainName,
     "Mail"
    )

     

    Note: Watch out of case while comparing values, change to Lower or Upper to be on the safe side.

     

    Uday

     

    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.

     

  • Gorilla_8 Profile Picture
    on at

    HAHAHAHAH @UdayAdhikari 

     

    Don't mess with me hahaha

    I'm just kidding... 😄

    So I tried your solution, but it didn't quite work out, unfortunately, what could?

  • Verified answer
    UdayAdhikari Profile Picture
    450 Most Valuable Professional on at

    @Gorilla_8  - ok, this should work now. Apologies, I could not reply sooner (gotta keep the day job)

     

    No change on app load/screen visible code:

    ClearCollect(
     colMailDomains,
     {DomainName: "outlook.com"},
     {DomainName: "gmail.com"}
    );
    
    ClearCollect(
     colAllEmails,
     Microsoft365Users.SearchUser({searchTerm: ""})
    );

     

    And add this code to your Gallery > Items property:

    Filter(
     colAllEmails,
     Last(Split(Mail,"@")).Result in colMailDomains
    )

     

    Let me know how it goes.

     

    Thanks

    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.

  • Gorilla_8 Profile Picture
    on at

    Hi @UdayAdhikari 

     

    I tried and there was no answer in the gallery.

  • UdayAdhikari Profile Picture
    450 Most Valuable Professional on at

    @Gorilla_8  - that's odd, I just tested and its working ok for me.

     

    Where did you put below code, on app OnStart or on screen OnVisible? Can you confirm colAllEmails is populated (has records) first. Can you please screen share your screen, form, gallery?

    ClearCollect(
     colAllEmails,
     Microsoft365Users.SearchUser({searchTerm: ""})
    );

     

  • Gorilla_8 Profile Picture
    on at

    Hi @UdayAdhikari 

    On visible and On Start

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 320

#3
Mohsin Ali Profile Picture

Mohsin Ali 246

Last 30 days Overall leaderboard