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

Trying to make powerapps to send email through flow but with SQL.

Hi people,  So im doing a referral kinda form. The data is imported from SQL. So i would like to know how i would be able to send email what user has filled in the form through Powerapps while updating SQL data and trggier flow to sending an email. I been trying to figure this out for so long now i still can't do it. I have attached screenshots for you guys to see what i am trying to do. 

 

Apart from that thank you and i hope i be able to figure this out soon.

 

2 REPLIES 2
Community Support
Community Support

Hi @Mixy,

Could you please share a bit more about your scenario?

Do you want to trigger a flow when the user inserts a record into your SQL table or updates an existing record within your SQL table?

Do you mean that your flow is not fired continuously?

If you want to triger a flow when the user inserts a record into your SQL table, I think your flow's configuration is proper.

If you want to triger a flow when the user updates an existing record within your SQL table, I think there is something wrong with your flow's configuration. You should modify the "When an item is created" trigger into the "When an item is modified" trigger within your flow.

In addition, I think it is not necessary to use a flow to send an email, you could consider send an email within your app directly.

Please check and see if the following blog would help in your scenario:

https://powerapps.microsoft.com/en-us/blog/html-email-reporting-with-tabular-data/

I have made a test on my side, please take a try with the following workarond:15.JPG

Add the following formula within the OnSuccess property of the Edit form control:

Office365.SendEmail(        /* <-- Add formula start */
    "Test1@xxxxx.xxmicrosoft.com",    /* <-- Here type your own specific email */
    "New Record is created in your SQL table",
    "<h3>Asset Checkout Notification</h3>" &
        "<strong> Items: </strong>" &
         "<table width='100%' border='1' cellpadding='5' style='border:1px solid black; border-collapse:collapse'>" &
           "<tr style='background-color:#efefef'>
             <th>X_REF_FNAME</th> <th> X_REF_LNAME </th> <th> X_REF_PHONE </th><th> X_REF_EMAIL </th>
           </tr>
           <tr>" &
             "<td>" & EditForm1.LastSubmit.X_REF_FNAME & " </td>
              <td>" & EditForm1.LastSubmit.X_REF_LNAME & " </td>
              <td>" & EditForm1.LastSubmit.X_REF_PHONE & " </td>
              <td>" & EditForm1.LastSubmit.X_REF_EMAIL & " </td>
        </tr><tr>" &"</table>",
    {IsHtml:true}
);    /* <-- Add formula end */
Back()

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi, Sorry for my bad explanation and Thank you so much for your reply.

So what i trying to do with this whole thing is when user fill out the referral form i wanted it to store data in my sql and send an automated email something like "Thank you for signing up "Name" Here is your "ID"".  So i thought using flow would help since im really new to Powerapps. I have used the code that you gave me and try to work it out but i'm really confused (Sorry im really bad). 2018-12-11 11_11_38-Window.png

This is my flow that i have created and trying to test it.
2018_12_11_11_14_03_.pngBut it seems that it gets stuck on the sql every time. Never sends out any emails what so ever.

Do you know maybe why? If not that's completly fine. Overall I'm pretty much useless when it comes to code i know little about it unfortunately. Sorry if I'm making this difficult for you. 

 

Thanks for you reply once again.  

 

 

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 (74,986)