Select to view content in your preferred language

Formatting select_multiple response

614
3
12-14-2022 12:44 PM
dannigart
Emerging Contributor

Hi everyone!

The responses for select_multiple are recorded in the order they are selected and then separated with commas. I would like the responses to be listed in the order I've provided in the options and I would like there not to be commas separating them. I've provided a screenshot of what it looks like below: 

dannigart_0-1671050614335.png

And what I would prefer: 

dannigart_1-1671050652282.png

 

Any help would be greatly appreciated, thank you!

Danni

0 Kudos
3 Replies
DougBrowning
MVP Esteemed Contributor

Well it is possible but its ugly. No built in way that I know of.  Here is what I had to do.  But really I would reconsider.  Using data in this format is a major pain down the line.  I spend a lot of time pulling it back apart.  One part I am not positive on is getting the order perfect.

You can add a calc field that strings together each option using the separator of choice.  Or no separator at all in your case.

selected-at(${Rash13},0) + selected-at(${Rash13},1) + selected-at(${Rash13},2).... and list out as many options as you have so you get them all.  If only say 2 are checked it will only give you the 2 values in the calc field.  Again not positive if the order is the order of the list or the order they hit the checkbox.  

Also note I have done this string the label vs the value together as well doing this

concat(jr:choice-name(selected-at(${Rash13},0), '${Rash13}'), ' ', jr:choice-name(selected-at(${Rash13},1),.....

I guess you could also do a bunch of if statements

if(selected(field, value1), value1, "") + if(selected(field, value2), value2, "") 

Again its ugly esp with lots of options but it should work to get the order perfect.

Hope that helps

JoshuaSharp-Heward
Frequent Contributor

Agree with the above poster, not easy to do with the calculations in Survey123. If you don't need the user to be seeing the values in that format within the form itself I would consider adding an empty hidden text field after the select multiple question and having a post processing script (potentially in ArcGIS Notebooks) format it for you, as it would be a lot simpler in Python.

dannigart
Emerging Contributor

Thank you both for your help! I think @JoshuaSharp-Heward 's suggestion that a post processing script may be the best solution such as in Python or an excel macro.

I appreciate your input!

0 Kudos