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
Community Champion
Community Champion

@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
Community Champion
Community Champion

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

RandyHayes
Super User III
Super User III

@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.
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
Community Champion
Community Champion

@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

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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,533)