cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Marco_h
Level: Powered On

Get all selected items from combobox

Hi guys,

 

im gettin crazy. i ve set up a combobox which uncludes the following items:

 

["1","2","3","4"]

 

i want to display the selected combobox items in a textlabel field (Text = combobox.Selected.Value).... but i only get the last selected combobox entry..... how do i get all of them ... ?

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft Employee

Re: Get all selected items from combobox

The field name dpeends on the data that you're trying to access. For example, imagine that you have "Accounts" table that has "AccountID", "Account Name" and "Company Name" fields. Now let's say that you want to allow the user to select the AccountID. In this case you set the ComboBox.Items = Accounts and then ComboBox.Selected.AccountID will be the value you're looking for. Alternatively, you could assign ComboBox.Items = Accounts.AccountID and in this case the ComboBox.Selected (not the .AccountID!) value will be the value you're looking for. This is why it is often hard to suggest the proper field name without knowing the underlying data structure.

Please also note that In some cases, the field name is automatically assigned. This usually happens when the ComboBox.Items is set to a formula. In those cases the .Result is usually used. I hope this helps you find the proper field name to use in your applciation.

View solution in original post

14 REPLIES 14
Microsoft Employee

Re: Get all selected items from combobox

Hello Marco_h,

 

Please use "SelectedItems" instead of "Selected". Something like the following should work:

Label1.Text=Concat(ComboBox1.SelectedItems, Value&",")

 

Please note that "Selected" is mostly used in "single selection" mode (ComboBox1.SelectMultiple=false).

"SelectedItems" property however contains all the selected items in "multiple selection" mode. The type of that property is "Table" and therefore I used the "Concat" function in my example.

PowerApps Staff LanceDelano
PowerApps Staff

Re: Get all selected items from combobox

Push the selected combobox data to a collection then use concatenate to bring them into a single text field.   See https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/create-update-collection  which should help along with https://powerusers.microsoft.com/t5/Connecting-to-Data/convert-table-column-to-string/td-p/87539.  See the attachment. 

cholopa
Level: Powered On

Re: Get all selected items from combobox

Hello:

 

The links above aren't working any more, I have the same issue. I want to get the selected value from a combo box and view some ather filed of that selected value.

 

If I want to get the selected value from a display list is fairly easy:

 

LookUp('Orden de trabajo';numero_OT=ot_seleccionada.Selected.Value;nombre_ot)

 

Where:

'orden de trabajo' is the entity

"ot_seleccionada" is the name of the display list box

"numero_OT" is the name of the field from "orden de trabajo" wich I'm getting from "ot_seleccionada"

nombre_ot is the name of the field I want to see from the select item in "ot_seleccioanda"

 

How can I do something similar with a combobox?

 

 

cholopa
Level: Powered On

Re: Get all selected items from combobox

To put it simple:

 

From a display list, I can get the selected item and view it in a text field with:

 

****.selected.value

 

If a combo box has only one selected item, how can I get the selected value in a text field?

 

Microsoft Employee

Re: Get all selected items from combobox

For a ComboBox control in a "Single Select" mode (SelectMultiple=false) the selected item can be retrieved as ComboBox1.Selected

For a ComboBox control in a "Multi Select" mode (SelectMultiple=true) that has only one selected item, it can be retrieved as 

First(ComboBox1.SelectedItems)

Does this answer your question?

cholopa
Level: Powered On

Re: Get all selected items from combobox

Hi:

 

Thanks for the support

 

I have (SelectMultiple=false) 

 

When I try in a text box, text fill with:

 

ComboBox1.Selected

 

I get the following error(translate form spanish):

 

Property expected text value, but this rule generates record values not compatible.

 

I've tried also First(ComboBox1.SelectedItems), but same results...

 

By the way Combobox is getting the data from a "lookup" entity....

 

Any clue¿?

 

 

 

 

Microsoft Employee

Re: Get all selected items from combobox

ComboBox.Selected references the selected item (record). Try ComboBox.Selected.Value

MK1
Level: Powered On

Re: Get all selected items from combobox

hi @dinusc,

I tried to use Combobox.selected.value. But its giving me error on the text box and not populating what ever i select on combo box.

When i use combobox.selected.Result i was on,y able to get one value populated into thetext box.

Any ideas to fix this would help.

Thanks,

MK

Microsoft Employee

Re: Get all selected items from combobox

The field name dpeends on the data that you're trying to access. For example, imagine that you have "Accounts" table that has "AccountID", "Account Name" and "Company Name" fields. Now let's say that you want to allow the user to select the AccountID. In this case you set the ComboBox.Items = Accounts and then ComboBox.Selected.AccountID will be the value you're looking for. Alternatively, you could assign ComboBox.Items = Accounts.AccountID and in this case the ComboBox.Selected (not the .AccountID!) value will be the value you're looking for. This is why it is often hard to suggest the proper field name without knowing the underlying data structure.

Please also note that In some cases, the field name is automatically assigned. This usually happens when the ComboBox.Items is set to a formula. In those cases the .Result is usually used. I hope this helps you find the proper field name to use in your applciation.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,644)