Select to view content in your preferred language

JS function to grab the multiselect label?

142
2
02-05-2025 05:49 AM
TL2
by
Frequent Contributor

I am trying to grab multiselect question result and create a list as they are populated.  Anyone have a script that can do this?  I have one that crabs the names and creates a list but not the label.  How do you grab the label of a multiselect with JS?

0 Kudos
2 Replies
ZacharySutherby
Esri Regular Contributor

Hello @TL2

You would need to use the jr:choice-name function to return the labels for the selected responses and pass that into your JS function. 

For example, concat(jr:choice-name(selected-at(${select_multiple}, 0), '${select_multiple}'), ',', jr:choice-name(selected-at(${select_multiple}, 1), '${select_multiple}'), ',', jr:choice-name(selected-at(${select_multiple}, 2), '${select_multiple}'), ...)

Thank you,
Zach
0 Kudos
TL2
by
Frequent Contributor

I suppose you could do a query on a HFS in the function?  

0 Kudos