cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Livewire101_10
New Member

Trouble sending selected items in ComboBox in an Email

I am trying to send an email summarizing the submission of a Form.  In the form I have a DataCard that has a ComboBox input that accepts multiple selections.  I have tried using:

 

SubmitForm(Form1);Office365Outlook.SendEmailV2("email@site.com","Subject",""Defect: "&Form1.LastSubmit.Defect.Value);

 

But, since the Defect DataCard is multi-select the Value is a table and is not compatible with LastSubmit.

 

How do I grab the selected items from the Defect DataCard and send them in the email?

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@Livewire101_10 

First, your SubmitForm should be the ONLY function in your formula.

Never add additional functions after the SubmitForm for 2 reasons:

1) SubmitForm starts when you issue that formula.  It does not wait to complete.  It moves on to evaluate the next function in the formula.  So there is no guarantee that the submitform has completed by the time it gets to the next function.  So, LastSubmit directly after that function may be invalid and inaccurate. The form provides an OnSuccess action that lets you do additional actions after the form submits successfully.

2) If you issue a function after the SubmitForm....how do you know it submitted without error?  You don't! and therefore you can be performing an action that will confuse users.  This, again, is what the OnSuccess action on the form is for.

 

SO, your formula to submit the form should ONLY be:  SubmitForm(Form1)

Your OnSuccess action formula should be:

 

Office365Outlook.SendEmailV2(
    "email@site.com",
    "Subject",
    "Defect: " & Concat(Self.LastSubmit.Defect, Value & ", ")
);

 

The Concat function in that formula will provide a comma separated list of the values in your multi-select column.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

2 REPLIES 2
Jeff_Thorpe
Super User
Super User

Try using Concat() like this:

 

SubmitForm(Form1);Office365Outlook.SendEmailV2("email@site.com","Subject",""Defect: "&Concat(Form1.LastSubmit.Defect, Value, ","));



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
RandyHayes
Super User
Super User

@Livewire101_10 

First, your SubmitForm should be the ONLY function in your formula.

Never add additional functions after the SubmitForm for 2 reasons:

1) SubmitForm starts when you issue that formula.  It does not wait to complete.  It moves on to evaluate the next function in the formula.  So there is no guarantee that the submitform has completed by the time it gets to the next function.  So, LastSubmit directly after that function may be invalid and inaccurate. The form provides an OnSuccess action that lets you do additional actions after the form submits successfully.

2) If you issue a function after the SubmitForm....how do you know it submitted without error?  You don't! and therefore you can be performing an action that will confuse users.  This, again, is what the OnSuccess action on the form is for.

 

SO, your formula to submit the form should ONLY be:  SubmitForm(Form1)

Your OnSuccess action formula should be:

 

Office365Outlook.SendEmailV2(
    "email@site.com",
    "Subject",
    "Defect: " & Concat(Self.LastSubmit.Defect, Value & ", ")
);

 

The Concat function in that formula will provide a comma separated list of the values in your multi-select column.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

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