
Hi,
In my original 1-page / 1-form power app I entered the the following in the OnSuccess field of the form, triggered by a button with SubmitForm(Form1). That worked perfectly.
Office365Outlook.SendEmailV2("xxx@hotmail.com";"New employee";
"<b>New employee. Begin Pre-boarding.</b><br>
<b>First name </b>" & Form1.LastSubmit.Title & "<br>
<b>Last name </b>" & Form1.LastSubmit.Lastname & "<br>
<b>E-mail </b>" & Form1.LastSubmit.'Private email';
{
IsHtml: true;
Importance: "High"
}
);;
Now I have made a new power app with forms on two pages (form1 and form2). I used this setup: Multiple Screen Form Control in Power Apps - YouTube (see especially 9.40 and 21.54)
Now I want to email the values of the first page.
With multiple forms I have to use Patch and the result of the code below is that I receive the email, but without the values.
What do I have to change in order to get the values into my email?
Patch(Onboarding;varFormData;Form1.Updates;Form2.Updates);;
Office365Outlook.SendEmailV2("xxx@hotmail.com";"New employee";
"<b>New employee. Begin Pre-boarding.</b><br>
<b>First name </b>" & varFormData.Title & "<br>
<b>Last name </b>" & varFormData.Lastname & "<br>
<b>E-mail </b>" & varFormData.'Private email';
{
IsHtml: true;
Importance: "High"
}
);;
I finally solved it! I should have used Form1.Updates.[field name]
This works:
Patch(Onboarding;varFormData;Form1.Updates;Form2.Updates);;
Office365Outlook.SendEmailV2("xxx@hotmail.com";"New employee";
"<b>New employee. Begin Pre-boarding.</b><br>
<b>First name </b>" & Form1.Updates.Title & "<br>
<b>Last name </b>" & Form1.Updates.Lastname & "<br>
<b>E-mail </b>" & Form1.Updates.'Private email';
{
IsHtml: true;
Importance: "High"
}
);;