I have a dropdown menu with 5 Menu options.
{
"Video 1": 0,
"Video 2": 1,
"Video 3": 2,
"Video 4": 3,
"Video 5": 4
}
I also have 5 buttons, that activate something but I want each button to be labelled as one label from the Dropdown menu,
So
- Button 1 = Video 1
- Button 2 = Video 2
- Button 3 = Video 3
- etc.
The List in the Dropdown menu will be constantly updated i want the buttons to adjust their name based on that dropdown list.
is there a way to do this?
thanks for the support!
Set the button's label to
#{Object.keys(@{switch_1.values})[0]}
Replace [0]
with [1]
for the second button, etc.
1 Like
I honestly dont know how - but I imagine you have 5 screens infront of you just watching the forum all day everyday and answering all the questions!! Thank you so much! you're the best!
Hi, sorry stupid question again!
now that I can get the name, I can populate the button perfectly, but is there also a way to seperately get the value that is attached to this drop down?
{
"LIVE SIGNAL": -1,
"Video 1": 2,
"Video 2": 3,
"Video 3": 4,
"Video 4": 5
}
so for instance I would like to get the Value 2 for Video 1, Value 3 vor Video 3 and so on in a text box. much like using "#{Object.keys(@{switch_1.values})[0]}" is the a way to get the value instead of the name?
thank you
FOUND IT!
changed .keys to .values
#{Object.values(@{ColScr_Selection_1.values})[0]}
like magic!
1 Like