cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate IV
Advocate IV

Convert combo box selected items into a string

I'm trying to send the selected items in a combo box to a string for output. I know I can out individual selected items several different ways but I can't figure out how to convert all of them into one contiuous string.

I can show the first;

First(ComboBox1.SelectedItems).Title

Or the last;

Last(ComboBox1.SelectedItems).Title

And I can find the number of selected items;

CountA(ComboBox1.SelectedItems.Title)

But how do I get the first last and everything in between?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Advocate IV
Advocate IV

Re: Convert combo box selected items into a string

I found the answer

Concat(ComboBox1.SelectedItems, Title & ", ")

View solution in original post

12 REPLIES 12
Highlighted
Advocate IV
Advocate IV

Re: Convert combo box selected items into a string

I found the answer

Concat(ComboBox1.SelectedItems, Title & ", ")

View solution in original post

Highlighted
Helper IV
Helper IV

Re: Convert combo box selected items into a string

hi 

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 only able to get one value populated into thetext box.

Any ideas to fix this would help.

Thanks,

MK

Highlighted
Helper IV
Helper IV

Re: Convert combo box selected items into a string

hi

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 only able to get one value populated into thetext box.

Any ideas to fix this would help.

Thanks,

MK

Highlighted
Advocate IV
Advocate IV

Re: Convert combo box selected items into a string

It would appear from what you typed that you are not using the correct key property. For a multi-select combo box you would use Combobox.SelectedItems, not Combobox.selected.value.

When you use Combobox.SelectedItems you are referring to a table of records not values, so you need to still reference which value(column) from each record you want as a result. In my example I was wanting to combine the Title column from the selected records, therefore my formula was like this.

Concat(ComboBox1.SelectedItems, Title & ", ")

Hope this helps.

Brian

 

 

Highlighted
Helper IV
Helper IV

Re: Convert combo box selected items into a string

Hi @Brian_,

 

I tried to use 

Concat(ComboBox1.SelectedItems, Title & ", ")

But,In my scenario I'm filtering combobox values based on Another dropdown

Dropdown1:

Filter('Data Sources',Product.Value="XXXX") 

so, dropdown1 will have 3 products(A,B,C)

When a user selects B  product, it will populate other combobox with its product values.

On Combobox i'm using a lookup column which is releated between datasurce1 and datasource2. And I'm filtering the product values into combobox.

Distinct(Filter(Datasource2,Details.Id=Datasoruce.Selected.ID),ProductValues)

So, now when i select multiple product values form Combobox it should populate another texbox with these details.

 Concat(ComboBox.SelectedItems, ComboBox.Selected.Result & ", ")

when i do this whatever i select first is populating multipletimes into the textbox.

can you help me with this scenario.

Highlighted
Advocate IV
Advocate IV

Re: Convert combo box selected items into a string

Sorry, it's been a long day and I need to look at this when I'm fresh but I did notice you are referring to one selected item in your formula, which is why you are getting the repeating result in the textbox.

 Concat(ComboBox.SelectedItems, ComboBox.Selected.Result & ", ")

ComboBox.Selected.Result refers to one particular selected item, not a column from the table of results.

In this 

Concat(ComboBox1.SelectedItems, Title & ", ")

"Title" refers to a column, not any particular selected item. You need to refer to a column in the reults of the selected items.

For example if you ComboBox records which you are selecting from contain the columns "ID", "Product", and "ProductValues" your formula may look like any of these;

Concat(ComboBox1.SelectedItems, ID & ", ")
Concat(ComboBox1.SelectedItems, Product & ", ")
Concat(ComboBox1.SelectedItems, ProductValues & ", ")

 

Highlighted
Advocate IV
Advocate IV

Re: Convert combo box selected items into a string

So I had a thought this morning. If you aren't sure what fields you have to choose from to put in place of where I had "Title", do this.

Add a Data Table to the screen where the combobox is temporarily and set the data source as the combobox.SelectedItems

Once you've selected an item you can go to the DataTable and see a selection of fields that are available to populate the table.

Hope this helps.

Brian

Highlighted
Advocate I
Advocate I

Re: Convert combo box selected items into a string

Well done, @Brian_

Highlighted
Solution Supplier
Solution Supplier

Re: Convert combo box selected items into a string

@Brian_thanks for this (I found it in a search for exactly the same question). Do you know how to strip off the trailing comma?

Helpful resources

Announcements
secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,036)