Widget of type variable

Hi, in a switch widget i have a lot of key / value pairs. in the script property i now want to set some variable widgets with an array of values.

The variable should have an array like [0,1,1] and [“knobname1”,“knobname2”,…]
So far no problem (set(‘id’,[0,1,1])).

now i want to toggle with this information the visability of the knobs (0,1,1) -> hide first knob, show second and third. The next step would be to label the knobs in the html property with “knobname1” , “knobname2”

but @{id[0]} (visible property of the knob 1 ) gave an undefined?

Thanks!

id[0] is not a widget id (which is what the @{} syntax expects), the [0] part is a javascript way of getting an array’s item so you have to use the JS{{}} or the #{} syntax if you want to make it work: #{@{id}[0]}

1 Like