Closed paulmacmillan closed 4 years ago
In case this was closed by accident, here is a snippet:
JS{{
var object = @{switch_1.values},
value = @{switch_1}
return Object.keys(object).find(key => object[key] === value)
}}
Thank you so much for your help ! So quick to answer as usual. In fact I found another solution you posted earlier on discourse and didn't want to bother you ^^ Btw, it's very kind of you to give the explanation for the solution though so we can better understand.
Hi Jean-Emmanuel, first of all thank you for the amazing work you're doing on this project ! Truly mind blowing.
Here is the situation :
if we have a switch component with a
values
field like :Is there a way, when using the advanced syntax (
@{id.value}
) to set thelabel
field of another component, to use the key (or label as described in the documentation) (here it would be homer) instead of the value (simpson).Been reading the doc for hours now and cannot find the way to do it.
Thanks for your help