Screen 1;
In combo box 1 I have Items = ["Apple", "Orange", "Pear", "Banana"]
OnChange = UpdateContext({SelectedFruit: ComboBox1.SelectedItems})
Selected values need to saved as comma separated text string:
button.OnChange = UpdateContext({Fruits:Concat(SelectedFruit,Value&",")})
Fruits are then saved to a SPO text column
Screen 2:
I have another combo box and a button
Combo box 2.Items = ["Apple", "Orange", "Pear", "Banana"]
I retrieve the value from the SPO column,
Retrieved value = "Pear,Banana,"
but first need to split it to convert to array
DefaultSelectedItems = ForAll(Split(Fruits,","),{Fruit:Result});
However, no values display.
Thanks in advance
Hello @RandyHayes,
My combo box values are from another SharePoint list column of single line text type, whereas the selected option need to be saved to another SharePoint list's column of type as single text. Saving is working well also the retrieval, but the values are not sync to the options in the combo box.
Thanks & Best Regards,
Santosh
Yeah, I used to trim the text, but found it much easier to just filter the blanks out like in the formula.
Glad it is moving forward for you now...
That was exactly it. My bad. I totally neglected to trim that last comma.
I see you have a trailing comma on your values...didn't notice it before. For that, change formula to the following:
RenameColumns(Filter(Split(Fruits,","), !IsBlank(Result)), "Result", "Value")
Thanks for your response @RandyHayes
Unfortunately, that didn't work for me. Seems straightforward enough, however, the "Fruits" variable still display as a test string.
Consider the following change to your DefaultSelectedItem property:
RenameColumns(Split(Fruits,","), "Result", "Value")
Your Items property specifies a single column table with a column called Value:
["Apple", "Orange", "Pear", "Banana"] is turned into the following:
[{Value:"Apple"}, {Value:"Orange"},{Value:"Pear"},{Value:"Banana"}]
So to get default selected items to match, you need to match the column names. So the above formula will rename the "Result" column to "Value" - which will match.
I hope this is helpful for you.
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
Super User 2025 Season 2
mmbr1606
275
Super User 2025 Season 2