Using the setValue function for a List Box

Hi there - I have a couple of questions that I hope someone may be able to help me with

  1. I have a List Box configured, which is all working well. The Data source is the selectedItems property of a Switch Group component. I want to update the data in the List Box via a JS Query using the setValue function, but it seems to have no affect. Should I expect to be able to update the values in the List Box using this function...?

  2. Can I dynamically change the height of the list box? So if the number of items in the list increase from 2 to 8, the height of the box will increase to accommodate them (rather than scrolling)..?



Hey there :wave: You should be able to set the value of the component out of the given options, i.e.:

If you are looking to set more than one value, you could point the values to a temporary state and change it there?

As for dynamically changing the height of the list box, that is not currently an option, but you could use custom CSS -- I am linking a helpful community post on that here.