Hello the Community,
I would like get the last user selection of a combobox.
For example, in my Combobox, I have 3 items ["item1", "item2", "item3].
Firstly, the user selects "item1" and after "item2". Now, here I want display in a TextBox : "Your last selection is item1" (with a variable for example)
It works with a Dropdown and its onSelect property, but I need features of Combobox (mostly isSearchable and reset). So I can not use a Dropdown.
Could you help me ?
Bye.
Charlie.
Thank a lot for your help.
I understand the way to do it.
Bye.
I'm using the ComboBoxSample data that is structured like the image below. You'll need to adapt the code to fit the Items in your ComboBox.
In the OnChange property of your ComboBox, enter:
Collect(boxHistory, {value: Self.Selected, index: Last(boxHistory).index + 1})
In your label/textbox, enter this for the Text property, where "Value1" is the field you want to display from the ComboBox.
LookUp(boxHistory, index = Last(boxHistory).index - 1).value.Value1
Result:
Be sure to clear the collection at the appropriate time so it doesn't retain the history past where you want it to.
Hello,
Unfortunately, this update the lastSelected variable with the new value of my ComboBox, so like Set(lastSelected, Self.Selected.<Value>)
In the OnChange of ComboBox, try UpdateContext({lastSelected: Self.Selected.<Value>}), where <Value> is the item value you want to capture. Then your label/textbox could be "Your last selection is " & lastSelected.
WarrenBelz
146,645
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional