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
@Anonymous
You did not follow my instructions or let me know the result. Suggest you do exactly as I say.
In app for ,
Name (textInput) i use: Office365Users.MyProfile().DisplayName
Manager (TextInput)i use : Office365Users.Manager(First(Office365Users.SearchUser({searchTerm:Name_TextInput2.Text})).Mail).DisplayName)
and in email part:
// Send email to submitter
Set(emailTo, Office365Users.MyProfile().DisplayName & "; " & Office365Users.Manager(First(Office365Users.SearchUser({searchTerm:Name_TextInput2.Text})).Mail).DisplayName & ";");
Office365Outlook.SendEmailV2(emailTo,"Emp Request","<table>"&DataTable1_3.Selected.'Name of employee'&",<tr><tr><tr>Your Travel Request for " &DataTable1_3.Selected.Destination& " on " &DataTable1_3.Selected.'Departure date'& " was " &AppRej_Radio1_3.Selected.Value&" by " &User().FullName&" <td><tr><tr>comments: </td></tr></tr>"&Comments_TextInput1_3.Text&"</table>",{Importance:"High"})
showing error status: 400
message: one or more recipients are invalid
@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."
#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
@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?
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
@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."
yeah, Ok. Please do the needful.
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.
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
791
Most Valuable Professional
MS.Ragavendar
410
Super User 2025 Season 2
mmbr1606
275
Super User 2025 Season 2