Send Email Using MSFlow On Button Click From PowerApps

Introduction

 
In this blog, I will explain how to send an email on button click from PowerApps through MSFlow. This blog will help us in how to trigger a flow from PowerApps, passing dynamic values to Microsoft flows. I have divided this blog into mainly three subcategories and they are as mentioned below,
  1. Creation of List
  2. Creation of Power Apps
  3. Creation of MS Flows

Creation of List

  • I have created a Custom List in SharePoint online environment.
  • The list name is “ListFlow”.
  • I have created three columns (Email, Subject, and Body) in this list and they are shown in the below screenshot.


Creation of Power Apps

  • Once the list is created with these three columns then please create a PowerApps named “Email Notification”.
  • For creating Power Apps please click on “PowerApps” from ribbon and then click on “Create an app”

     

  • Now it will show as it is showing in the below-mentioned screenshot. 


  • Now, add a button for sending the email. Please follow the steps (8 and 9) for adding the button.
  • Click on Insert from Ribbon menu.
  • Then Click on Button (refer below screenshot).


  • Name the button on text property as “Notify”. (please refer below mentioned screenshot)


  • Now the setup is completed in the PowerApps.

Creation of MS Flow

  • Now Let's create a MSFlow on the button (Notify) click.

Procedure

  • Click on the “Notify” button.
  • Click on “Create a new flow” under Action (please refer below screenshot)


  • After clicking on “Create a new flow” it will just open the Data window. Then it will take you to the Flow Studio
  • Now click on the “Click a button in PowerApps to send an email”. (as shown below)

     
  • Now click on the “Continue” button.


  • Now build the email with the details for Email, Subject, and Body. Then click on the “Save” button.


  • Now, this new flow will show up as it has shown in the below-mentioned screenshot.


  • Now click on the red cross mark showing in the “Notify” button.


  • Then click on the “Edit in the formula bar” then it will show up the formula bar in top.


  • Now I have passed the Email, subject, and body from the app as mentioned below:

    BrowseGallery1.Selected.Email – parameter for email.
    BrowseGallery1.Selected.Subject – parameter for the subject.
    BrowseGallery1.Selected.Body – parameter for the body.


  • Now just save the app, publish and send the email on click.



Output Email
 
 

Conclusion

 
In this blog, I have shown how to create PowerApps, create flows, trigger them from PowerApps, and pass the dynamic values to flows.