I have created form with approx 140 fields for a new employee to submit his details.
Database: SQL Server Enterprise Edition
Connection: On-premise gateway
Objective: On successful submission of data to the database, an email with all the details in the form to pre-defined individuals.
Any help would be highly appreciated.
The problem you will get is that the OnSuccess statement of an EditForm will reset every values of your form.
I do send a mail also on one of my apps.
I proceed like that :
- On the OnSelect statement of my button for the SubmitForm, I make a context variable (UpdateContext) taking value of all my actual values of the form before my SubmitForm
- On the OnSuccess statement of the form, you put "Office365.SendMail(To,Subject,Body(MyContextVariable))"
Hope that could help you.
My view may be a little different. I have the view to keep the PowerApp as simple as possible. SQL Server is extremely powerful and flexible. If I was assigned this I would do it in SQL Server. I would create an SQL CLR stored procedure to send an HTML formatted email. It would run every 5 minutes looking for new records, create the email and send it to list. This way you don't have to kludge a solution in the PowerApp.
Thank you Louis for your response.
Please guide me how did you take all the values of the form using UpdateContext. I have relatively less experience with PowerApps
In my case, I would like to take all the 140 fields as mail body.
Thank you for your response.
This is a nice way of doing it and I would prefer to give it a try.
Will you be able to guide me any specific articles which can help me with this?
I haven't actually done this. I'm using Azure SQL DB and it doesn't support SQL CLR. I'm doing something similar using Azure Function Apps. Here is an article.
Personally, my list doesn't have more than 10 columns so I did it manually...
I don't see any way else to do that
For UpdateContext, you can do like that :
Then, use your variables in your mail body
Keep me informed of the situation
Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.
Continue your learning in our online communities.
Features releasing from October 2019 through March 2020
Coming to a city near you
Fill out a quick form to claim your user group badge now!
Connect, share, and learn with your peers year-round