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 / A button is sending a ...
Power Apps
Answered

A button is sending a two emails rather than one

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello, hopefully someone can help this PowerApps noob with what is probably a basic question.

 

I have two buttons which send different emails. The body of each email is drawn from a hidden label on the canvas. 

 

Button one is b_ScriptSave2, has the following code and works as expected:

 

 

SubmitForm(form_script);
Office365Outlook.SendEmail("****@****.com", "*Automated Email* Please review a script change", EditEmailText.Text);
Set(viewsavescript, false);
Set(var_Edit, false);
Set(var_EditBlocker, false)

 

 

 

Button two is b_SubmitRequest and has the following code:

 

 

Office365Outlook.SendEmail("****@****.com", "*Automated Email* A script change has been requested", RequestEmailText.Text);
Set(var_viewrequest, false);
Set(var_EditBlocker, false);
Reset(ti_ChangeRequest)

 

 

and RequestEmailText has the following code:

 

 

Office365Users.MyProfile().GivenName & " " & Office365Users.MyProfile().Surname & " has requested a change to a script.

Request Notes:
" & ti_ChangeRequest.Text & "

Please review this request and make any necessary changes in the app."

 

 

 

b_SubmitRequest does something strange...if Text Input ti_ChangeRequest is left blank the email will send as expected. However, if there is text in ti_ChangeRequest, two emails are sent. The first email is as expected, but the second email has the subject from b_SubmitRequest but the body from b_ScriptSave2. 

 

I can't for the life of me figure out why. Can anyone help please?

 

Thanks

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    155,752 Most Valuable Professional on at

    Hi @Anonymous ,

    A bit strange, but also try this in RequestEmailText

    User().FullName & " has requested a change to a script.
    Request Notes:
    " & ti_ChangeRequest.Text & "
    
    Please review this request and make any necessary changes in the app."

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it 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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 483

#2
WarrenBelz Profile Picture

WarrenBelz 399 Most Valuable Professional

#3
11manish Profile Picture

11manish 327

Last 30 days Overall leaderboard