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

Help Sending Form in an Email from PowerApps Button

Hi,

 

I am currently creating a PowerApp where a form is filled out by a user and then sent in an email when a button is selected. In the form there is a title (text), location (choice), request (choice), and additional comments (text) section. The button to submit the form and send the email is in a custom data card within the form. So far I can get an email to send when the button is selected but the values and formatting are not working. Below are two methods that I have tried in the button on select field but the values aren't showing in the email and the formatting isn't working. Could someone please give me direction on what I might be doing wrong?

 

First Method (plain email):

Office365Outlook.SendEmail(
    "kkrushinsky@lacrossefootwear.com",
    "Quality Support Needed - " & TitleValue.Text,
    "<b>Call Number:</b>" & TitleValue.Text & "<b>Location:</b>" & ThisItem.Location.Value & "<b>Request:</b>" & ThisItem.Request.Value & "<p><b>Additional Comments:</b>" & AdditionalCommentsValue.Text,
    {Importance: "High"}
)


Second Method (table format):

Office365Outlook.SendEmail("myemail@gmail.com","Quality Support Needed - " & TitleValue.Text,"
<table>
  <tr>
    <th><b>Call Number:</b></th>
    <th><b>Location:</b></th>
    <th><b>Request:</b></th>
    <th><b>Additional Comments:</b></th>
  </tr>" & 
  Concat(QualityCallSystem,"<tr>
    <td>" & Title & "</td>
    <td>" & ThisItem.Location.Value & "</td>
    <td>" & ThisItem.Request.Value & "</td>
    <td>" & AdditionalComments & "</td>
  </tr>") & 
"</table>", {Importance:"High"})​
2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Help Sending Form in an Email from PowerApps Button

Hi @kkrushinsky ,

You are missing the HTML parameter - either do this

Office365Outlook.SendEmailV2(
    "kkrushinsky@lacrossefootwear.com",
    "Quality Support Needed - " & TitleValue.Text,
    "<b>Call Number:</b>" & TitleValue.Text & 
   "<b>Location:</b>" & ThisItem.Location.Value & 
   "<b>Request:</b>" & ThisItem.Request.Value & 
   "<p><b>Additional Comments:</b>" & AdditionalCommentsValue.Text & "</p>,
    {Importance: "High"}
)

or this

Office365Outlook.SendEmail(
    "kkrushinsky@lacrossefootwear.com",
    "Quality Support Needed - " & TitleValue.Text,
    "<b>Call Number:</b>" & TitleValue.Text & 
   "<b>Location:</b>" & ThisItem.Location.Value & 
   "<b>Request:</b>" & ThisItem.Request.Value & 
   "<p><b>Additional Comments:</b>" & AdditionalCommentsValue.Text & "</p>,
    {
       Importance: "High",
       IsHtml:true
    }
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

Highlighted
Community Support
Community Support

Re: Help Sending Form in an Email from PowerApps Button

Hi @kkrushinsky ,

Based on the issue that you mentioned, I think this issue is related to the ThisItem operator.

 

When your Edit form is in New Mode (you are going to enter a new entry), the 

ThisItem.Location.Value

and the

ThisItem.Request.Value

would return blank value in default. So please reference the Location data card value and Request data card value directly from your Edit form without using ThisItem operator.

 

On your side, please consider modify your formula as below:

Office365Outlook.SendEmailV2(
    "myemail@gmail.com",
    "Quality Support Needed - " & TitleValue.Text,
    "<b>Call Number:</b>" & TitleValue.Text & "<p><b>Location:</b>" & 
    LocationComboBox.Selected.Value &       // Modify formula here
    "<p><b>Request:</b>" & 
    RequestComboBox.Selected.Value &        // Modify formula here
    "<p><b>Additional Comments:</b>" & AdditionalCommentsValue.Text,
    {Importance: "High"}
);
SubmitForm(Form1)

Note: The LocationComboBox, and the RequestComboBox represents the ComboBox inside your Gallery, which you pick up the location option and request option from.

 

In addition, you could also consider type your Office365Outlook.SendEmailV2() function within the OnSuccess property of the Edit form as below:

Office365Outlook.SendEmailV2(
    "myemail@gmail.com",
    "Quality Support Needed - " & EditForm1.LastSubmit.Title,
    "<b>Call Number:</b>" & 
    EditForm1.LastSubmit.Title & 
    "<p><b>Location:</b>" & 
    EditForm1.LastSubmit.Location.Value &       // Modify formula here
    "<p><b>Request:</b>" & 
    EditForm1.LastSubmit.Request.Value &        // Modify formula here
    "<p><b>Additional Comments:</b>" & EditForm1.LastSubmit.AdditionalCommentsField,
    {Importance: "High"}
);

Set the OnSelect property of the "Submit" button to following:

SubmitForm(Form1)

 

Best regards,

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.

View solution in original post

5 REPLIES 5
Highlighted
Super User III
Super User III

Re: Help Sending Form in an Email from PowerApps Button

Hi @kkrushinsky ,

You are missing the HTML parameter - either do this

Office365Outlook.SendEmailV2(
    "kkrushinsky@lacrossefootwear.com",
    "Quality Support Needed - " & TitleValue.Text,
    "<b>Call Number:</b>" & TitleValue.Text & 
   "<b>Location:</b>" & ThisItem.Location.Value & 
   "<b>Request:</b>" & ThisItem.Request.Value & 
   "<p><b>Additional Comments:</b>" & AdditionalCommentsValue.Text & "</p>,
    {Importance: "High"}
)

or this

Office365Outlook.SendEmail(
    "kkrushinsky@lacrossefootwear.com",
    "Quality Support Needed - " & TitleValue.Text,
    "<b>Call Number:</b>" & TitleValue.Text & 
   "<b>Location:</b>" & ThisItem.Location.Value & 
   "<b>Request:</b>" & ThisItem.Request.Value & 
   "<p><b>Additional Comments:</b>" & AdditionalCommentsValue.Text & "</p>,
    {
       Importance: "High",
       IsHtml:true
    }
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

Highlighted
Community Support
Community Support

Re: Help Sending Form in an Email from PowerApps Button

Hi @kkrushinsky ,

Based on the formula that you mentioned, I think there is something wrong with it. You have missed "IsHtml" property within your 

Office365Outlook.SendEmail

formula. I agree with @WarrenBelz 's thought almost.

 

For your second formula, please modify it as below:

Office365Outlook.SendEmail("myemail@gmail.com","Quality Support Needed - " & TitleValue.Text,"
<table>
  <tr>
    <th><b>Call Number:</b></th>
    <th><b>Location:</b></th>
    <th><b>Request:</b></th>
    <th><b>Additional Comments:</b></th>
  </tr>" & 
  Concat(QualityCallSystem,"<tr>
    <td>" & Title & "</td>
    <td>" & ThisItem.Location.Value & "</td>
    <td>" & ThisItem.Request.Value & "</td>
    <td>" & AdditionalComments & "</td>
  </tr>") & 
"</table>", 
           {
             IsHtml: true,      // Add property here to format the HTML Tag you typed in your email body
             Importance: "High"
           }
)​;
SubmitForm(EditForm1)   // Add the SubmitForm function after the Office365Outlook.SendEmail function

Note: Please type the SubmitForm function after the Office365Outlook.SendEmail function, otherwise, the data you collected from your Edit form directly would not show up in your email body.

 

Best regards,

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.
Highlighted
Super User III
Super User III

Re: Help Sending Form in an Email from PowerApps Button

@v-xida-msft ,

Thank you for confirming (almost) my post.
@kkrushinsky you are probably better using the V2 of the send email as it detects HTML automatically.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Highlighted
Regular Visitor

Re: Help Sending Form in an Email from PowerApps Button

Thank @WarrenBelz  and @v-xida-msft for your suggestions!

 

I went ahead and changed the send email to send email V2 to make things easier. Below is how my code reads. The formatting is correct now but it still doesn't send the values for Location and Request (see attachment). Any ideas on why this isn't working? I think part of the issue is they are choice and it is looking for text but they way I have them set up is in text format.

 

Office365Outlook.SendEmailV2(
    "myemail@gmail.com",
    "Quality Support Needed - " & TitleValue.Text,
    "<b>Call Number:</b>" & TitleValue.Text & "<p><b>Location:</b>" & ThisItem.Location.Value & "<p><b>Request:</b>" & ThisItem.Request.Value & "<p><b>Additional Comments:</b>" & AdditionalCommentsValue.Text,
    {Importance: "High"}
);
SubmitForm(Form1)

 

Highlighted
Community Support
Community Support

Re: Help Sending Form in an Email from PowerApps Button

Hi @kkrushinsky ,

Based on the issue that you mentioned, I think this issue is related to the ThisItem operator.

 

When your Edit form is in New Mode (you are going to enter a new entry), the 

ThisItem.Location.Value

and the

ThisItem.Request.Value

would return blank value in default. So please reference the Location data card value and Request data card value directly from your Edit form without using ThisItem operator.

 

On your side, please consider modify your formula as below:

Office365Outlook.SendEmailV2(
    "myemail@gmail.com",
    "Quality Support Needed - " & TitleValue.Text,
    "<b>Call Number:</b>" & TitleValue.Text & "<p><b>Location:</b>" & 
    LocationComboBox.Selected.Value &       // Modify formula here
    "<p><b>Request:</b>" & 
    RequestComboBox.Selected.Value &        // Modify formula here
    "<p><b>Additional Comments:</b>" & AdditionalCommentsValue.Text,
    {Importance: "High"}
);
SubmitForm(Form1)

Note: The LocationComboBox, and the RequestComboBox represents the ComboBox inside your Gallery, which you pick up the location option and request option from.

 

In addition, you could also consider type your Office365Outlook.SendEmailV2() function within the OnSuccess property of the Edit form as below:

Office365Outlook.SendEmailV2(
    "myemail@gmail.com",
    "Quality Support Needed - " & EditForm1.LastSubmit.Title,
    "<b>Call Number:</b>" & 
    EditForm1.LastSubmit.Title & 
    "<p><b>Location:</b>" & 
    EditForm1.LastSubmit.Location.Value &       // Modify formula here
    "<p><b>Request:</b>" & 
    EditForm1.LastSubmit.Request.Value &        // Modify formula here
    "<p><b>Additional Comments:</b>" & EditForm1.LastSubmit.AdditionalCommentsField,
    {Importance: "High"}
);

Set the OnSelect property of the "Submit" button to following:

SubmitForm(Form1)

 

Best regards,

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.

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (6,510)