cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

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
Highlighted
Microsoft
Microsoft

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

15 REPLIES 15
Highlighted
Microsoft
Microsoft

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.

Highlighted
Power Apps
Power Apps

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. 

Highlighted
Helper II
Helper II

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?

 

 

Highlighted
Helper II
Helper II

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?

 

Highlighted
Microsoft
Microsoft

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?

Highlighted
Helper II
Helper II

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¿?

 

 

 

 

Highlighted
Microsoft
Microsoft

Re: Get all selected items from combobox

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

Highlighted
Helper IV
Helper IV

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

Highlighted
Microsoft
Microsoft

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

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,704)