[Checkbox tree].checked - alternative to display labels


I'm trying to write a notification similar to:

In this context, checkboxtree2.checked returns the values e.g. 21056; 20154 where I am looking to return the labels (e.g. 'Product 1, Product 2')

I don't believe this is a current option but please let me know if it is

Hey @qlmoffat!

Happy to help here! I tested this on my end and it looks like this should work. Since this is an array, I believe we try parsing these values into a string automatically but you could do this more explicitly by using something like {{checkboxTree2.checked.join(", ")}}. Are you getting any errors with your current setup?

Thanks @Chris-Thompson

It is still only showing the 'value' as opposed to 'label' (example in second screenshot)



Hey @qlmoffat — I see what you mean here :thinking: this definitely seems like a feature we should have for this component. I'll write up an internal feature request. In the meantime, our best bet here may be to recursively traverse the tree to find the matching Label or depending on where these values are coming from we could match them elsewhere. I'll keep this thread updated as this is implemented.

1 Like