cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Regular Visitor

sendmailv2 with specific subject

hi,

 

i´m just building my first powerapp. after the form is submitted an email should send to a specific user with a specific subject. therefore i actually use the following command

 

OnSelect = SubmitForm(EditForm1);;Office365Outlook.SendEmailV2("test@contoso.de";LastnameText;"Body text")

 

The email is going out BUT always contains the value from the first element in the list. 

 

Subject should be = A new user request for "Lastname.Text" has been added


i watched so many videos and cant find the error. any idea or tip?

 

many thanks

Tim

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

I believe the SubmitForm() maybe changing the value. Try this instead:

 

Set(varSubject;DataCardValue6.Text);;
SubmitForm(EditForm1);;
Office365Outlook.SendEmailV2("test@contoso.de";varSubject;"Body text")

 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

3 REPLIES 3
Super User
Super User

I believe the SubmitForm() maybe changing the value. Try this instead:

 

Set(varSubject;DataCardValue6.Text);;
SubmitForm(EditForm1);;
Office365Outlook.SendEmailV2("test@contoso.de";varSubject;"Body text")

 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

Hi @Jeff_Thorpe ,

 

many thanks, its working with the following command!!!

 

Set(varSubjectLastname;DataCardValue2.Text);;Set(varSubjectFirstname;DataCardValue1.Text);;SubmitForm(SharePointForm1);;Office365Outlook.SendEmailV2("test@contoso.de";"New request for " & varSubjectLastname & varSubjectFirstname;HtmlText1.HtmlText)

 

Maybe you have another tip for me. Between varSubjectLastname & varSubjectFirstname i want to set a comma that the subject looks like "New request for lastname, firstname".

 

Happy new year of course 😀🎉

Super User
Super User

Happy New Year @ekime89 ,
You should be able to format the entire subject the way you want in a variable and use the variable in the SendEmail() function. It would look like this:

 

 

Set(varSubject, Concatenate("New request for "; DataCardValue2.Text ; ", "; DataCardValue1.Text));;
SubmitForm(SharePointForm1);;
Office365Outlook.SendEmailV2("test@contoso.de"; varSubject; HtmlText1.HtmlText)

 

 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (77,861)