cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JimSutt
Helper III
Helper III

Concatenating Selected Items from a ComboBox Sourced by a Delimited String

I'm trying to save a delimited string of selected values from a ComboBox.  This ComboBox (cbUserResponse) is sourced from a single, delimited text string stored in a label (tmpAnswerOptions).  

 

tmpAnswerOptions.Text = "Option1,Option2,Option3"

cbUserResponse.Items = Split(tmpAnswerOptions.Text,",")

 

In the OnChange property of the the ComboBox, I'm trying to use Concat to build a comma delimited string of the values selected.  Since this ComboBox is not sourced from a table of data, I'm unable to get the Concat function to work.

 

Concat(cbUserResponse.SelectedItems, Value & ", ")

 

The above code does not recognize "Value" since this source of the ComboBox is not a table.  

2 ACCEPTED SOLUTIONS

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @JimSutt ,

Try

Concat(cbUserResponse.SelectedItems, Result & ", ")

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

RandyHayes
Super User
Super User

@JimSutt 

Your problem is that you are using split which returns a single column table with the column named Result.

Value does not exist in the table.

So, Concat(cbUserResponse.SelectedItems, Result & ", ")

You need not do this in an OnChange action though - this can be derived from any place in your app!

 

Also, to reduce the problem of the trailing comma and space, your formula should be the following:

With({_l: Concat(cbUserResponse.SelectedItems, Result & ", "), Left(_l, Len(_l)-2))

 

This will be important if you plan to repopulate a combobox later with the concated text and a split.

 

I hope this is helpful for you.

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

View solution in original post

3 REPLIES 3
WarrenBelz
Super User
Super User

Hi @JimSutt ,

Try

Concat(cbUserResponse.SelectedItems, Result & ", ")

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

RandyHayes
Super User
Super User

@JimSutt 

Your problem is that you are using split which returns a single column table with the column named Result.

Value does not exist in the table.

So, Concat(cbUserResponse.SelectedItems, Result & ", ")

You need not do this in an OnChange action though - this can be derived from any place in your app!

 

Also, to reduce the problem of the trailing comma and space, your formula should be the following:

With({_l: Concat(cbUserResponse.SelectedItems, Result & ", "), Left(_l, Len(_l)-2))

 

This will be important if you plan to repopulate a combobox later with the concated text and a split.

 

I hope this is helpful for you.

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

View solution in original post

JimSutt
Helper III
Helper III

Thank you @WarrenBelz  and @RandyHayes !!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,369)