I have a combo box in my app that allows multiple selections, and I have a separate label that displays the selections from the combo box. I'm doing this because there could be many selections and I want the user to be able to see them all at a glance. It works fine when the user is choosing new items in the combo box. They show up fine in the label.
However, when you navigate from a gallery on another screen and the combo box is populated with default selected items, the label doesn't show anything.
My combo box is in a form. The Items that populate the combo box come from a collection. (The items property of the combo box is Collection.Title).
The defaultselecteditems property of the combo box is:
RenameColumns(Filter(Split(Parent.Default, ";"), !IsBlank(Result)), "Result", "Value")
The text property of my label is: Concat(ComboBox1.SelectedItems, Title& Char(13))
Any suggestions would be greatly appreciated. Thanks!
Thank you very much for your help. The problem was that my column type was set to Rich Text and I didn't realize it!
Your code works fine in my sample on a MultiLine of Text column using 'Plain Text'. Check for errant code snippets eg a comma or ')' somewhere. Is there some other code in this Text property that you are also trying to apply eg an If() statement?
I'd just clear out all the code in this property then copy and paste your code back in to see if that works
EDIT: I meant to ask, are you using Plain text or Rich/Enhanced text on your column. Plain text causes the least amount of issues in PowerApps. The other two can be quite difficult to work with
The Audit_sample column type is "multiple lines of text" where the values are separated by ";" and Char(13).
What column type is Audit_sample? I assumed it is a Single Line of Text where values are separated by ‘;’
Thanks for your help. I'm having some trouble getting that code to work. I get an error that says the funtion "Split" has some invalid arguments:
This is what I pasted into the text property of my label:
Concat(
Split(
ThisItem.Audit_sample,
";"
),
Result & Char(13)
) & Concat(
Filter(
ComboBox1.SelectedItems,
!IsBlank(Title)
),
Title & Char(13)
)
Audit_sample is the name of my column in Sharepoint. I also tried Title in its place, but that didn't work either..
This works
Concat(
Split(
ThisItem.yourColumnName,
";"
),
Result & Char(13)
) & Concat(
Filter(
ComboBox1.SelectedItems,
!IsBlank(Title)
),
Title & Char(13)
)
However, an issue I found was if you remove any existing items displayed in your Combo Box (ie from the existing record) then these aren't removed from the label. Not sure if that's a needed function but there's probably a few ways to do this ...
I did find that your code works perfectly fine when using a Choice column and the Choices() function, it just doesn't seem to like collections for the ComboBox Items.