How to send email from PowerApps button submit

PowerApps send email from button click

No comments

Loading

PowerApps send email – in this PowerApps Tutorial, we will learn how to send an email from the PowerApps button click event. Actually,  when we click on the send email button in PowerApps, it internally triggers the Power Automate flow, so, it is an integration between PowerApps and Power Automate. Let’s get started on how this works.

PowerApps send email from the button click step by step

Step 1:

Create a sample PowerApps canvas app.

Add a new email template screen from the “New screen” selection.

And a button to trigger send email Power Automate event.

Add email template screen in PowerApps
Add email template screen in PowerApps

Note:

  • While we add an email template screen, all the textbox controls like “To”, “Subject”, and “Message” are validated out of the box as this template is integrated with the office 365 mailbox.

PowerApps send email : Create a flow from Power Automate to send the email

Select the send email button.

Go to the action tab.

Click on Power Automate as shown below (3).

Create a flow from Power Automate to send the email
Create a flow from Power Automate to send the email

Now, if we have already developed the send email Power Automate flow, we can select it from the available flows. Here we have already developed the flow “Click a button in PowerApps to send email”, so we can select this flow, however, we are not selecting it intentionally to show how to create the new flow from Power Automate.

So, let’s click on the “+ Create a new flow” link.

Now, you will be asked to log in to the Power Automate (Microsoft Flow) screen.

After successful login, you will also see lots of Power Automate flow template actions, select the one that we are interested in i.e. “Click a button in Power Apps to send an email”.

Click a button in Power Apps to send email Power Automate
Click a button in Power Apps to send an email using Power Automate

Click on the “Click a button in Power Apps to send an email” action.

In the next screen, it will establish a connection with Office 365 Outlook.

Click on the continue button, then click on the create button.

PowerApps send email - Create connection with office 365 Outlook
Click a button in Power Apps to send an email – Create a connection with office 365 Outlook

PowerApps send email: Associate the flow with the PowerApps button to send the email

Select the email sending button, and on the “OnSelect” event select the flow that you have created to send the email, the flow will ask to send the parameters.

Flow associated with button in PowerApps to trigger the email event
Flow associated with button in PowerApps to trigger the email event
ClickabuttoninPowerAppstosendanemail.Run(TextSearchBox1.Text,TextEmailSubject1.Text,TextEmailMessage1.Text);Navigate(EmailSendingSuccessMessage, ScreenTransition.Fade)

Description About the send email from PowerApps PowerAutomate

In the above example “ClickabuttoninPowerAppstosendanemail” is the flow name and after the dot run, we need to pass the parameter “To,”, “Subject”, and “Message Body” parameters. And using the navigate function we are just redirecting the email screen to the successful message screen. The Power Automate integration with PowerApps is like a normal function in other traditional programming languages where we write the function in one place and we call the function from other places and pass the function parameters accordingly.

PowerApps button click event – demo

Run the canvas app in preview mode and pass the “To”, “Subject” and “Message” parameters.

PowerApps button click event demo
Send an email from the PowerApps button click event –  demo

Then click on the “Click here to send email” button, and the email will be sent to the recipients.

Summary: What we had here (PowerApps send email from the button click)?

Thus, in this article, we have learned how to send email from the PowerApps button click event and how to trigger the send email Power Automate from the PowerApps.

See Also: PowerApps Tutorial

You may also like the below PowerApps articles:

Reference

Buy SharePoint Online eBook

Buy the premium version of SharePoint Online & Office 365 administration eBook from here:


Buy SharePoint Online & Office 365 Administration eBook

 

 

About Post Author

Do you have a better solution or question on this topic? Please leave a comment