cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mickow
Helper II
Helper II

Combining multiple choice from combo box to one row in excel

Hi, could you help me with an issue...

 

I'm building an app where I'm gathering data from COMBO BOXES and after clicking a button I want to update row in the esxel fine on One Drive. The thing is that there is a multiple selection available in those combo boxes, but when I hit the button - only one of selected answers is recorded in excel file. For example I have selected codes: 1234;5678;98765 and only the last one after semicolon will be sent to excel. Is there a way to fix this and send all selected to the excel file? It's important to keep it this ways as this app is also sending an email with such table written in HTML and those should look pretty similar. In the attachment sending the email and excel tabe (on yellow marked where two codes should be, but there is one only).

 

//Because as I understand - it is not possible to create rows as in the email right? //

 

 

mail_example2.pngmail_example (2).png

1 ACCEPTED SOLUTION

Accepted Solutions
CNT
Super User
Super User

@Mickow Try this code,

Patch(
  Table4PowAu, 
  Defaults(Table4PowAu), 
  {xCode : xCode.Selected.x0020_Code_x0020_ID, 
  xCode_1 : xCode_1.Selected.x0020_Code_x0020_ID, 
  Country : Concat(Country.SelectedItems, Value, ";"), 
  DueDate : Text(
    DueDate.SelectedDate, "dd/mm/yyyy"
  ), 
  Urgent : If(
    Checkbox1.Value = true, "Yes", "No"
  ), 
  Notes : AddNote.Text, 
  SubmittersName : User().FullName, 
  SubmittersEmail : User().Email}
)

 

View solution in original post

6 REPLIES 6
zmansuri
Super User
Super User

In your code to submit data to excel. Use ComboBox.SelectedItems instead of ComboBox.Selected

RandyHayes
Super User
Super User

@Mickow 

What is your formula you are using to submit the values to Excel?

 

Can you explain what you mean by Rows in an Email?

_____________________________________________________________________________________
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!

Hi, well... when I'm simply changing from Selected to SelectedItems I get an error that the argument does not meet the expected type "Text"... 

@RandyHayes This is my code:

 

Patch(Table4PowAu,
Defaults(Table4PowAu),
{xCode:xCode.Selected.x0020_Code_x0020_ID,
xCode_1:xCode_1.Selected.x0020_Code_x0020_ID,
Country:Country.Selected.CountryCode,
DueDate:Text(DueDate.SelectedDate,"dd/mm/yyyy"),
Urgent:If(Checkbox1.Value=true,"Yes","No"),
Notes: AddNote.Text,
SubmittersName:User().FullName,
SubmittersEmail:User().Email}

 

And what I mean in the backslashed sentence is that as I assume it is not possible to add with PowerApps in the excel sheet multiple (3 in my case) rows at the same time. I can add just one row with multiple columns, right? 

CNT
Super User
Super User

@Mickow Try this code,

Patch(
  Table4PowAu, 
  Defaults(Table4PowAu), 
  {xCode : xCode.Selected.x0020_Code_x0020_ID, 
  xCode_1 : xCode_1.Selected.x0020_Code_x0020_ID, 
  Country : Concat(Country.SelectedItems, Value, ";"), 
  DueDate : Text(
    DueDate.SelectedDate, "dd/mm/yyyy"
  ), 
  Urgent : If(
    Checkbox1.Value = true, "Yes", "No"
  ), 
  Notes : AddNote.Text, 
  SubmittersName : User().FullName, 
  SubmittersEmail : User().Email}
)

 

Just to make it clear to everyone new to PowerApps... "VALUE" in this code will be "CountryCode", because it might suggest that value is some part of the code itself (which makes no sense, but can create a little confusion if you are not a coder).  

 

Thanks 🙂

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 (1,766)