Hello Community,
I'm not sure if this function is possible, but I want to capture the values from a 'select_multiple' question in another text field. The problem is that the choices also include 'Other color,' which I capture on another text question. I want to capture ALL the selected values from the multiple-choice question except the 'Other' value, and then combine all the values. The final text field will include all the selected values from 'select_multiple' (except 'Other') and the value from the question ${add_other}. (see image). I can't figure out how to concat the list without including "other' as part of the list. Any suggestions?
Thanks,
JB

Update****************SOLVED
After many attempts, I was able to accomplish the desired outcome. Not the most elegant solution, but it works. The expression checks if 'Other color' is selected in ${colorList}. If it is, it concatenates the part of ${colorList} before and after 'Other color' to exclude it. Otherwise, it keeps ${colorList} unchanged. I combined the final selected list using the 'concat' function in ${allColor}. Here's the final expression in case someone else encounters a similar requirement.
if(selected(${colorList}, 'Other color'),
concat(
substring-before(${IndOrgCollectDataList}, 'Other color'),
substring-after(${IndOrgCollectDataList}, 'Other color')
),
${colorList}
)
Thanks,
JB