Can I use substr function in "select one" using name not label?


I have “Select One” type question. From these Question I am selecting
“Division” + “Location” and using substr(${Q1},0,3) , I am creating unique ID:

Here I can use substr() function using label of the “select one” question.

But this label has “name” in “choice” tab.
Is this possible I can select name when I choosing label?

May be I am not explaining properly.
Shall I share my xlsx form?


Asif R Joy

Maybe this workaround shared below should be able to show you how you should be able to use substr to extract the information from a select-one question type:

In the survey tab of your XLSForm:

Image 1

In the choices tab of your XLSForm:

Image 1.0

Data entry screen as seen in Enketo:

Reference XLSForm:

substr from Jr choice name.xlsx (11.4 KB)

1 Like

Hello @asif_rahman_joy,
Just to add:
${…} references always refer to the “name” column (in survey as well as in choices).

1 Like

Thanks a lot… :+1: :+1:

1 Like