How do I reference the currently selected "label" from a switch?

I’ve created a switch object with 20 items. The labels are names and the values are integers.
I’ve created a text object that I want to display the label of the currently selected switch item.

@{switch.value} returns the integer value for the item, but I need the label.
@{switch.label} returns “undefined”
@{switch.values} returns “[object Object]”

Any tips?

Thank you

Currently this is the only way to do it:

JS{{

var values = @{switch.values},
    v = @{switch}

return Object.keys(values).find(k => values[k] == v)

}}
1 Like

Works great, thank you