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 / i want to send an emai...
Power Apps
Answered

i want to send an email to the submitter(ie, current user) and also to send the email to the Current users manager.

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have a submit screen with list of fields like User, Manager of the user and Title. Here the

*User is a current user so it automatically displays the User Name(Name_TextInput2.Text) by Hard coded -

Office365Users.MyProfile().DisplayName.

*And to get the Manager of the entered user by default(emp_Text22) by Hard coded-
If(!IsBlank(Name_TextInput2.Text), Office365Users.Manager(First(Office365Users.SearchUser({searchTerm: Name_TextInput2.Text})).Mail).DisplayName). This works fine.

 

Needed is: i need two different emails to send for two different screens.

1)Now if i click the submit its wants to send the email to both the user and the manager depends on the name in the Manager text box field(emp_Text22)  and with the html content of the submitted values.

2)For another screen i have a Data Table to store the submitted records. So all the users entries records are stored in DataTable1_1. if i select any one of the record in table then click submit ,the mail wants to send to the name of the employee as well as to the employee manager. I hardcore like this its shows error and didn't receive the mail too.

Clear Collect(Recipients,Office365Users.Manager(User().Email).Mail);
Office365Outlook.SendEmail(Concat(Recipients,Value&";"),"Emp Request","<table>"&DataTable1_1.Selected.'Name of employee'&",<tr><tr><tr>Your  Request for " &DataTable1_1.Selected.Destination& " on " &DataTable1_1.Selected.'Departure date'& " was " &AppRej_Radio_1.Selected.Value&" by " &User().FullName&" <td><tr><tr>comments: </td></tr></tr>"&Comments_TextInput1_1.Text&"</table>",{Cc:"",Importance:"High"});

 

please help. Thanks in advance

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    154,799 Most Valuable Professional on at

    Hi @Anonymous 

    Firstly, your Clear Collect should be ClearCollect - correct this and see what the collection called Recipients looks like.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    In Powerapp  ClearCollect is hard-coded in the way you mentioned. But still its showing error and didn't get the email once i click submit. please clarify my needs.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    i already have email coded like this to submitter but now i also want to send email with Cc to the current user's Manager(TextInput2).

     

    // Send email to submitter
    Office365Outlook.SendEmailV2(First(Office365Users.SearchUser({searchTerm:DataTable1.Selected.'Name of employee'})).Mail," Request","<table>"&DataTable1.Selected.'Name of employee '&",<tr><tr><tr>Your  Request for " &DataTable1.Selected.Destination& " on " &DataTable1.Selected.'Departure date'& " was " &AppRej_Radio1.Selected.Value&" by " &User().FullName&" <td><tr><tr>comments: </td></tr></tr>"&Comments_TextInput1.Text&"</table>",{Cc:"",Importance:"High"});

  • WarrenBelz Profile Picture
    154,799 Most Valuable Professional on at

    Sorry - I just spotted what I thought was an obvious error.

    I am not an O365 directory user - I will tag one of my colleagues @mdevaney to see it he can assist.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    yeah, Ok. Please do the needful.

  • mdevaney Profile Picture
    29,991 Moderator on at

    @Anonymous 

    Do I understand correctly that the problem is you are trying to send an email but nothing happens?  I think it would be best to narrow the list of possible issues.  Please try both of these tests.

     

    #1 Change the connector to SendEmailV2.  You should never use SendEmail since it is deprecated and could be deleted at any time by Microsoft.

     

    Office365Outlook.SendEmailV2(
        Concat(Recipients,Value&";"),
        "Emp Request",
        "<table>"&DataTable1_1.Selected.'Name of employee'&",<tr><tr><tr>Your Request for "
            &DataTable1_1.Selected.Destination& " on " &DataTable1_1.Selected.'Departure date'& " was "
            &AppRej_Radio_1.Selected.Value&" by " &User().FullName&" <td><tr><tr>comments: </td></tr>
            </tr>"&Comments_TextInput1_1.Text&"</table>",
        {Cc:"",Importance:"High"}
    );

     

    #2 Try inputting your own email address in the 1st argument and attempt to send the email.  If you receive an email there is any issue with your Concat statement or recipients collection.

     

    Office365Outlook.SendEmailV2(
        "yourname@yourcompany.com",
        "Emp Request",
        "<table>"&DataTable1_1.Selected.'Name of employee'&",<tr><tr><tr>Your Request for "
            &DataTable1_1.Selected.Destination& " on " &DataTable1_1.Selected.'Departure date'& " was "
            &AppRej_Radio_1.Selected.Value&" by " &User().FullName&" <td><tr><tr>comments: </td></tr>
            </tr>"&Comments_TextInput1_1.Text&"</table>",
        {Cc:"",Importance:"High"}
    );

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Please take a time to look on it and do favor.

    I have a submit screen with list of fields like User, Manager of the user and Title. Here the

    *User is a current user so it automatically displays the User Name(Name_TextInput2.Text) by Hard coded -

    Office365Users.MyProfile().DisplayName.

    *And to get the Manager of the entered user by default(emp_Text22) by Hard coded-
    If(!IsBlank(Name_TextInput2.Text), Office365Users.Manager(First(Office365Users.SearchUser({searchTerm: Name_TextInput2.Text})).Mail).DisplayName). This works fine.

     

    Needed is: i need two different emails to send for two different screens.

    1)Now if i click the submit its wants to send the email to both the user and the manager depends on the name in the Manager text box field(emp_Text22)  and with the html content of the submitted values.

    2)For another screen i have a Data Table to store the submitted records. So all the users entries records are stored in DataTable1_1. if i select any one of the record in table then click submit ,the mail wants to send to the name of the employee as well as to the employee manager. How to add Manager as Cc in mail?. I hardcore like this its shows error and didn't receive the mail too.

     

    Clear Collect(Recipients,Office365Users.Manager(User().Email).Mail);
    Office365Outlook.SendEmail(Concat(Recipients,Value&";"),"Emp Request","<table>"&DataTable1_1.Selected.'Name of employee'&",<tr><tr><tr>Your  Request for " &DataTable1_1.Selected.Destination& " on " &DataTable1_1.Selected.'Departure date'& " was " &AppRej_Radio_1.Selected.Value&" by " &User().FullName&" <td><tr><tr>comments: </td></tr></tr>"&Comments_TextInput1_1.Text&"</table>",{Cc:"",Importance:"High"});

     

    please help. Thanks in advance

     

  • mdevaney Profile Picture
    29,991 Moderator on at

    @Anonymous 

    You have simply copied and pasted the text from your original post here.

     

    Did you try my suggestions?  Please tell me what happened for each of #1 and #2?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    #1 still the same problem persist. Didnt send mail..

    #2  Second one works fine. Now I got a mail. but what i need is once i click submit mail wants to send to user as well as the manager of the current user 

     

  • mdevaney Profile Picture
    29,991 Moderator on at

    @Anonymous 

    As a test, put each of these in a new Text label inside your app.  What do they show?

    User().Email
    Office365Users.Manager(User().Email).Mail

     

    If the emails show correctly load them into a SET variable

    Set(emailTo, User().Email & "; " & Office365Users.Manager(User().Email).Mail & ";")
    

     

    Then use the SET variable in your code to SendEmailV2

     

    Office365Outlook.SendEmailV2(
        emailTo,
        "Emp Request",
        "<table>"&DataTable1_1.Selected.'Name of employee'&",<tr><tr><tr>Your Request for "
            &DataTable1_1.Selected.Destination& " on " &DataTable1_1.Selected.'Departure date'& " was "
            &AppRej_Radio_1.Selected.Value&" by " &User().FullName&" <td><tr><tr>comments: </td></tr>
            </tr>"&Comments_TextInput1_1.Text&"</table>",
        {Cc:"",Importance:"High"}
    );

     

    Make sure to use SendEmailV2.  Let me know the result.  

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

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 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard