Hi,
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.
Thanks,
Vivek
Hi,
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.
Regards,
Louis
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.
@Anonymous
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.
Thanks,
Vivek
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?
Thanks,
Vivek
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 :
UpdateContext( {variable1:TextBox1.Value};
{variable2:TextBox2.Value};
{variable3:TextBox3.Value};
{variable4:TextBox4.Value})
Then, use your variables in your mail body
Keep me informed of the situation
Best regards,
Louis
Check out new user group experience and if you are a leader please create your group
Did you miss the call?? Check out the Power Apps Community Call here!
See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.
User | Count |
---|---|
275 | |
229 | |
79 | |
37 | |
37 |
User | Count |
---|---|
351 | |
232 | |
124 | |
70 | |
55 |