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 / sending an email to mu...
Power Apps
Answered

sending an email to multiple users

(0) ShareShare
ReportReport
Posted on by 1,625

Hi everyone,

 

I have a requirement to email 5 users, normally I would just reference the datacard like below:

Office365Outlook.SendEmailV2(VarPatchedRecord.IssuedTo.Email, "An application has been submitted by " & DataCardValue8.Selected.DisplayName, " Please review the application <br> <a href='https://apps.powerapps.com/play/--------------&PD=" & VarPatchedRecord.ID & "'> You can review and action the request here </a> "
 & "<br><br> Kind regards, <br>

 

The problem is I don't have a field with the 5 users but I have on my App OnStart a table:

 

Set(MyApprovers, 
Table({MyUser: "Email1.uk"},
 {MyUser: "Email2.uk"},
 {MyUser: "Email3.uk"},
 {MyUser: "Email4.uk"},
 {MyUser: "Email5.uk"}
));

But can't refer to that in my code.... any best practice how I achieve this please?

Categories:
I have the same question (0)
  • Mr-Dang-MSFT Profile Picture
    Microsoft Employee on at

    Hi @Lefty ,

    Suppose you have a table called MyApprovers with the 5 people you want to email. You can use the ForAll function to perform actions against each record in the MyApprovers table.

    ForAll(
     MyApprovers,
     Office365Outlook.SendEmailV2(
     MyUser,
     "Lorem ipsum dolor sit amet."
     )
    )

    This means, "For each of the approvers, use the O365 Outlook connector to send an email to each respective user with the given message."

     

    Let me know if you're able to use this. 

  • ShantanuP Profile Picture
    Microsoft Employee on at

    @Mr-Dang-MSFT suggested expression should work. Please also ensure that experimental feature, formula-level pre-fetching is disabled. There is an existing issue when you may see duplicate emails being send out when this feature is enabled.

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Lefty ,

    Do you want to send single one email to 5 users in your MyApprovers variable?

     

    I have made a test on my side, please consider take a try to modify your formula as below:

    Office365Outlook.SendEmailV2(
     Concat(MyApprovers, MyUser & ";"), // modify formula here
     "An application has been submitted by " & DataCardValue8.Selected.DisplayName, 
     " Please review the application <br> <a href='https://apps.powerapps.com/play/--------------&PD=" & VarPatchedRecord.ID & "'> You can review and action the request here </a> "
     & "<br><br> Kind regards, <br>"
    )

     

    In addition, I also agree with @Mr-Dang-MSFT 's thought almost. Please take a try with above formula, then check if the issue is solved.

     

    Best regards,

  • Lefty Profile Picture
    1,625 on at

    @Mr-Dang-MSFT @ShantanuP 

     

    I've tried this and this is my code, but now i get no email triggered to anyone, not even cc'd

     

    UpdateContext(
    	{
    	VarPatchedRecord:
    	Patch(
    		ListName, Defaults(ListName),
    		Form1_2.Updates,
     Form1_6.Updates,
    		Form1_7.Updates
     
     ) 
    	}
    );
    If(Not(IsBlank(VarPatchedRecord.ID)),Navigate(SuccessScreen);
    
    ForAll(MyApprovers,Office365Outlook.SendEmailV2(MyUser, "Application has been submitted by " & DataCardValue8.Selected.DisplayName, " Please review the application <br> <a href='https://apps.powerapps.com/play/0000000000000PID=" & VarPatchedRecord.ID & "'> You can review and action the request here </a> "

     

  • Lefty Profile Picture
    1,625 on at

    Hi @v-xida-msft 

     

    Having tried your suggestions, i'm not able to patch my form, this is my entire code on my submit buttons OnSelect:

    UpdateContext(
    	{
    	VarPatchedRecord:
    	Patch(
    		ListName, Defaults(ListName),
    		Form1_2.Updates,
     Form1_6.Updates,
    		Form1_7.Updates
     
     ) 
    	}
    );
    If(Not(IsBlank(VarPatchedRecord.ID)),Navigate(SuccessScreen);
    
    Office365Outlook.SendEmailV2(Concat(MyApprovers,MyUser & ";"),
    "An application has been submitted by " & DataCardValue8.Selected.DisplayName, " Please review the application <br> <a href='https://apps.powerapps.com/play/0000&PD=" & VarPatchedRecord.ID & "'> You can review and action the request here </a> "
     & "<br><br> Kind regards, <br>
    
    <br>Team name here
    <br><b>Team name here</b> 
    <br>Add here 
    <br>
    Email here"
    
    ,{Cc:DataCardValue8.Selected.Email & ";" & DataCardValue10.Selected.Email, Importance:"Normal"}))

     

  • ShantanuP Profile Picture
    Microsoft Employee on at

    @Lefty Please ensure that MyApprovers is not empty and has valid set of emails. Does it work when you just have that expression? You also have a If condition there, does Navigate get execute? You could also try putting ForAll before navigate. Both should work though.

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Lefty ,

    Is there something error message when you execute your whole formula?

    Do you mean that the Patch formula could not be executed successfully in your app?

    Have you tried to execute your Office365Outlook.SendEmailV2() formula individually in a button? Does it work?

     

    According to the issue that you mentioned, I think this issue is related to your Patch formula itself rather than the Office365Outlook.SendEmailV2() formula. Please try to execute your Office365Outlook.SendEmailV2() formula individually in a button, then check if the email sent out properly as expected.

     

    Please consider modify your formula as below:

    Set(
     VarPatchedRecord,
     Patch(
     ListName,
     Defaults(ListName),
    	 Form1_2.Updates,
     Form1_6.Updates,
    	 Form1_7.Updates
     
     )
    );
    If(
     !IsBlank(VarPatchedRecord),
     Navigate(SuccessScreen);Office365Outlook.SendEmailV2(Concat(MyApprovers,MyUser & ";"),
    "An application has been submitted by " & DataCardValue8.Selected.DisplayName, " Please review the application <br> <a href='https://apps.powerapps.com/play/0000&PD=" & VarPatchedRecord.ID & "'> You can review and action the request here </a> "
     & "<br><br> Kind regards, <br>
    
    <br>Team name here
    <br><b>Team name here</b> 
    <br>Add here 
    <br>
    Email here"
    
    ,{Cc:DataCardValue8.Selected.Email & ";" & DataCardValue10.Selected.Email, Importance:"Normal"}))

    If the issue still exists, please also consider remove the SP List connection from your canvas app, then re-create a new one to it from your canvas app, then try above formula again, check if the issue is solved.

     

    Regards,

  • Lefty Profile Picture
    1,625 on at

    HI @ShantanuP  @Mr-Dang-MSFT 

     

    Thanks for this, it nearly worked, issue was as I am cc in 2 users as part of my code, those 2 users get cc'd every time the approver from my list is emailed so in my case 5 times, otherwise this is a brilliant way when i need to hide who is being emailed.

    Is there anyway I can change the code to not have the users cc'd 5 times?

  • Lefty Profile Picture
    1,625 on at

    Hi @v-xida-msft 

     

    Thank you, your response previously was in fact correct, I had some required (mandatory fields) which were causing the problem... I've successfully been able to implement the emailing to multiple users using your suggestion 

  • Lefty Profile Picture
    1,625 on at

    Hi @v-xida-msft 

     

    How do I change your suggestion when i'm not patching, but writing to an existing record via this code:

    Office365Outlook.SendEmailV2(Form1_9.LastSubmit.IssuedTo.Email, "extension granted by : " & CurrentUser.FullName & " Ref number: " & DataCardValue34_5.Text, " Please review <br> <a href='https://apps.powerapps.com/play/00000&PD=" & Form1_9.LastSubmit.ID & "'> You can review and action the request here </a> "
    
    & "<br><br> Kind regards, <br>

     

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard