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 / How to send separate e...
Power Apps
Suggested Answer

How to send separate emails based on the multiple items selection in the gallery

(0) ShareShare
ReportReport
Posted on by 12
 
I just started with Power apps & automate (both free version) & got stuck in the below use-case.
 
Ask:
If I have to send separate emails based on the multiple items selection from the gallery then how to make it work? Does it require power automate flow or power apps is enough to send auto generated emails?
 
Scenario:
Dashboard access Request App: So my data is coming from sharepoint list ( Report Name, email address, icon). Create a gallery template & added icon & checkbox for multiple selection. So, if a user comes & select items in the gallery & click on submit’ button then it should send different emails to the respective persons for dashboard access approval.
 
Thanks in advance,
Skn
I have the same question (0)
  • MS.Ragavendar Profile Picture
    7,431 Super User 2026 Season 1 on at
     
    Without Power Automate you can send the e-Mail using Power-apps itself. 
     
    You have to do only Add the Office365Outlook connector to the app. Based on your design (App) you would have place the button to send e-Mail.
     
    In the button on Select 
     
    ForAll(
        Filter(Gallery1.AllItems, chk_BoxSelected.Value = true),
        Office365Outlook.SendEmail(
            EmailAddress,
            "Dashboard Access Request - " & ReportName,
            "User " & User().FullName &
            " has requested access to the dashboard: " & ReportName
        )
    );
    chk_BoxSelected -> We have added the checkbox inside the gallery.
     
    Note: ForAll will loop through all items for each items we will receive an eMail.
     
     
    This blog doesn't cover your complete implementation but this will give you basic idea to implement.
     
    ✅If this helped, please Accept as Solution to help others ❤️ A Like is appreciated 🏷️ Tag @MS.Ragavendar for follow-ups.
  • CU25041308-0 Profile Picture
    12 on at
     
    Thanks for the response, will look into the reference. 
     
    Quick concern on the above solution:
     
    If a user select 2 checkboxes then the email draft should send like:
     
    Dear support team,

    A new dashboard access request has been submitted.
     
    Username:
    user email: 
    dashboard name:
     
    Please review the request & grant necessary permission.
     
    If I have to add a logo in the signature then what tweaks should be implemented in the button for all select?
     

     
  • CU25041308-0 Profile Picture
    12 on at
     
    If I have resource group name instead of individual emails owners for each report then how to handle the ‘To’ part of the email draft.
     
    Also, the body of the email should show all the selected dashboard names along with username & email id as mentioned above.
    +
    Is it possible to capture the logs as well - in online share-point excel or list?
     
    Thanks in advance!
     
     
  • Suggested answer
    Kalathiya Profile Picture
    2,456 Super User 2026 Season 1 on at
     
    #1. If it’s a mail-enabled group M365 Group then you can use this email directly in code instead of ThisItem.Email. 
     
    #2. Updated email body:
    ForAll(
        Filter(Gallery1.AllItems, Checkbox1.Value),
        Office365Outlook.SendEmailV2(
            ThisItem.Email,
            "Dashboard Access Request",
            "Dear Support Team, <br><br>" &
            "A new dashboard access request has been submitted. <br><br>
            Username: " & User().FullName & "<br>
            User Email: " & User().Email & "<br>
            Dashboard Name: " & ThisItem.'Report Name' & "<br><br>
            Please review the request and grant the necessary permissions."
        )
    )
    
    //Checkbox1 - Replace with your checkbox control name
    //Gallery1 - Replace with your gallery control name
     
    #3. Yes, you can capture the log as well like below:
    Assumed your SharePoint list have following column with data type: 
    Column Name Data Type Note
    Requestor Person or Group  
    Title Single line of text Just Rename Title column to Report Name
         
    Code: 
    Patch(
            'Request Logs',
            Defaults('Request Logs'),
            {
                Title: ThisItem.'Report Name',
                Requestor: {
                             '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
                              Claims: "i:0#.f|membership|" & User().Email,
                               Department: "",
                               DisplayName: User().FullName,
                              Email: User().Email,
                             JobTitle: "",
                             Picture: ""
    }
            }
        )
     
    Final code with Send an email and Create log entry in SharePoint list:
     
    ForAll(
        Filter(Gallery1.AllItems, Checkbox1.Value),
        //It's about the send an email
        Office365Outlook.SendEmailV2(
            ThisItem.Email,
            "Dashboard Access Request",
            "Dear Support Team, <br><br>" &
            "A new dashboard access request has been submitted. <br><br>
            Username: " & User().FullName & "<br>
            User Email: " & User().Email & "<br>
            Dashboard Name: " & ThisItem.'Report Name' & "<br><br>
            Please review the request and grant the necessary permissions."
        );
    
        //Create entry in SharePoint list - Log table
    	Patch(
            'Request Logs', //Replace with your list name
            Defaults('Request Logs'),
            {
                Title: ThisItem.'Report Name',
                Requestor: {
                             '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
                              Claims: "i:0#.f|membership|" & User().Email,
                              Department: "",
                              DisplayName: User().FullName,
                              Email: User().Email,
                              JobTitle: "",
                              Picture: ""
    					}
            }
        );
    );
     
     
    If this response resolves your issue, please mark it as the Verified Answer so it can help other community members as well.
    ---------------------------------------------------------------------------------

    📩 Need more help? Just mention @Kalathiya and I’ll be happy to assist.

    ✔️ If this answer helped you, please tick “Does this answer your question?” so it can be marked as the Verified Answer.

    💛 A Like always motivates me to keep contributing!

    ​​​​​​​
     
     
  • CU25041308-0 Profile Picture
    12 on at
    Hello @Kalathiya, thanks for the quick solution & explanation.

     
    QQ doubts:
    - I tried to use the resource group email but it says that “the email id wasn't found. If the email is correct then contact your admin first’. 
     
    - This final code should be passed in the on select properties of the button? Also If I have to add a logo in the signature then what tweaks in the final code should be implemented in the button for on select?
     
    - Do I have to convert the image logo in base64 or data URI format?
     
    Thanks again!
  • Suggested answer
    MS.Ragavendar Profile Picture
    7,431 Super User 2026 Season 1 on at
     
    Q: I tried to use the resource group email but it says that “the email id wasn't found. If the email is correct then contact your admin first’. 
    • Reason 1 :  If you stored something like Group Name (“BI Support Team”) instead of Mail address (“bi-support@company.com”), it fails.
    • Reason 2  : Mail-enabled group exists, but is restricted/hidden, Some organization hide groups from address lists or restrict who can send to them. In those cases, the connector may not resolve or may fail at send time.
    • Reason 3 : You’re using the group’s alias, not the full SMTP address, kindly use the full email address string.
    To check create a test button and check for the e-Mail

    Office365Outlook.SendEmailV2(
        "emailID@company.com",
        "Test",
        "Test email from Power Apps"
    )
    If this fails with the same message then it’s tenant/admin configuration (group mail settings / visibility / restrictions) you need to connect with your admin team of your organization as a community team we cannot able to resolve that.
     
    Q: This final code should be passed in the on select properties of the button?
     
    There is no such recommendation it should be always on button on Select based on the business requirement you can implement but if the mails are sending on Visible of the screen it will be confusing so we are following pattern for sending email from Power Apps is exactly that: set the button’s OnSelect to the SendEmail()
     
    Q: Also If I have to add a logo in the signature then what tweaks in the final code should be implemented in the button for on select?
    This is possible using Power Apps JSON(ImageControl.Image, IncludeBinaryData) and then placing that output inside the <img src="">. 
     
     
    Sample Code :
     
    Set(varLogo, JSON(imgLogo.Image, IncludeBinaryData)); // Getting JSON based Image 
     
    Set(varBody,
        "Dear Support Team,<br><br>" &
        "A new dashboard access request has been submitted.<br><br>" &
        "<b>Username:</b> " & User().FullName & "<br>" &
        "<b>User Email:</b> " & User().Email & "<br>" &
        "<b>Dashboard Name:</b> " & ThisItem.'Report Name' & "<br><br>" &
        "Please review the request and grant the necessary permissions.<br><br>" &
        "<img src='" & varLogo & "' width='140' />" // Passing the Image here.
    );
    Office365Outlook.SendEmailV2(
        ThisItem.Email,
        "Dashboard Access Request",
        varBody
    );
     
    Q: Do I have to convert the image logo in base64 or data URI format?
    Not Needed.
     
    ✅If this helped, please Accept as Solution to help others ❤️ A Like is appreciated 🏷️ Tag @MS.Ragavendar for follow-ups.
     

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard