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
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,232)