cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ekime89
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
Jeff_Thorpe
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
Jeff_Thorpe
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 😀🎉

Jeff_Thorpe
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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

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

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (74,592)