How to concat with more than one separator (using `,` and 'and') in a select multiple choice question?

Hi everybody. I would like to make a summary on a health data form. For that, my will is to put a resume of symptoms in a sentence for aknowledgment.
It may seems like: “the patient ${name} has the symptoms A, B, C, and D.”
My problem is that I would like to concat the symptoms A, B, C, D or more, with two separators. The coma “,” as common separator, and before the latest symptom I would like to have “and”. This may be adapting if we have two value selected (A and B) or if we have 7syptoms selected (A, B, C, D, E, F, and G)

@geodas8, do your symptoms A, B, C, D … G come from a select_multiple response from a previous question? Did you mean you wanted to display these in a note question at the end once the responses have been selected?

Yes. Yes too.

@geodas8, you could do it as outlined in the image shared below:

In the survey tab of your XLSForm:

In the choices tab of your XLSForm:

image

Data entry screen as seen in Enketo: when nothing is selected

image

Data entry screen as seen in Enketo: when one option is selected

image

Data entry screen as seen in Enketo: when two options are selected

image

Data entry screen as seen in Enketo: when all three options are selected

image

Reference XLSForm:

Displaying Labels.xlsx (17.7 KB)

1 Like

Thanks. It’s working. Wonderful.

1 Like