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

Email field values with multiple pages

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"
}
);;

1 ACCEPTED SOLUTION

Accepted Solutions
ArieH
Regular Visitor

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"
}
);;

View solution in original post

1 REPLY 1
ArieH
Regular Visitor

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"
}
);;

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (1,540)