# Using single text field to cover details of multiple options in label

**URL:** <https://forum.getodk.org/t/using-single-text-field-to-cover-details-of-multiple-options-in-label/40649>\
**Category:** Support\
**Tags:** form-design, odk-xlsform\
**Created:** [March 6, 2023, 4:17am UTC](https://forum.getodk.org/t/using-single-text-field-to-cover-details-of-multiple-options-in-label/40649 "2023-03-06T04:17:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saad](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/saad/32/4537_2.png) [@Saad](https://forum.getodk.org/u/Saad)\
**Post date:** [March 6, 2023, 4:17am UTC](https://forum.getodk.org/t/using-single-text-field-to-cover-details-of-multiple-options-in-label/40649/1 "2023-03-06T04:17:03Z")

</div>

Hi,

I have a SELECT-ONE type question, which has possible answer options as A, B, C, D and E. Every option, if selected, asks for entering the details of respective entry. Example: If A is selected, the next question (type=text) would ask the user to enter the details about option A. Same for all other options. Now, I need to program the label of this question to reflect the option selected for details (something like PLEASE ENTER THE DETAILS OF OPTION A. This way, I can use only a single text question to cover all 5 options, instead of putting 5 separate questions for all 5 options.

How do I do that? Please also note that A, B, C etc are shortened variables for example. In real form, I have options with names carrying spaces (like 'City School', ' Village School', etc.). I am mentioning this because I don't want to reflect the selected variable name in label (like City\_School) because this is aesthetically confusing for the user.

Thanks,  
Saad

---

<div class="post-metadata">

**Author:** ![iamnarendrasingh](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/iamnarendrasingh/32/2593_2.png) [@iamnarendrasingh](https://forum.getodk.org/u/iamnarendrasingh)\
**Post date:** [March 6, 2023, 4:18am UTC](https://forum.getodk.org/t/using-single-text-field-to-cover-details-of-multiple-options-in-label/40649/2 "2023-03-06T04:18:59Z")

</div>

Hey @Saad ,

Can you share this section in excel so It will be more helpful for us to resolve the issue?

Best,  
Narendra

---

<div class="post-metadata">

**Author:** ![Saad](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/saad/32/4537_2.png) [@Saad](https://forum.getodk.org/u/Saad)\
**Post date:** [March 6, 2023, 4:32am UTC](https://forum.getodk.org/t/using-single-text-field-to-cover-details-of-multiple-options-in-label/40649/3 "2023-03-06T04:32:53Z")

</div>

Attached.  
[exampleODK.xlsx](https://forum.getodk.org/uploads/short-url/nVTVaKhE28dRyWJ8MBfaUW7z7cq.xlsx) (260.1 KB)

---

<div class="post-metadata">

**Author:** ![iamnarendrasingh](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/iamnarendrasingh/32/2593_2.png) [@iamnarendrasingh](https://forum.getodk.org/u/iamnarendrasingh)\
**Post date:** [March 6, 2023, 7:06am UTC](https://forum.getodk.org/t/using-single-text-field-to-cover-details-of-multiple-options-in-label/40649/4 "2023-03-06T07:06:35Z")

</div>

Hey @Saad ,  
I added one new line for calculation and update the labels of key questions. Have a look at all of those.

[exampleODK\_NS.xlsx](https://forum.getodk.org/uploads/short-url/gYCrMQNYswrQNJTjadkTCgTcqPc.xlsx) (259.0 KB)

I am sure this will solve your issues.

Best,  
Narendra

---

<div class="post-metadata">

**Author:** ![ahblake](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/ahblake/32/22392_2.png) [@ahblake](https://forum.getodk.org/u/ahblake)\
**Post date:** [March 6, 2023, 7:08am UTC](https://forum.getodk.org/t/using-single-text-field-to-cover-details-of-multiple-options-in-label/40649/5 "2023-03-06T07:08:51Z")

</div>

I think I have done something that is similar to what you are aiming for.

I did it to try to get less of a sparse matrix in the output and achieved this by dynamically setting both the question label, hint & options. But in order to know what the asked question was, I also had to return the question text as a field. In my case, I had ~20 categories, each with up to 5 questions, so I could either have 100 fields, or I could have 10 (5 with question text, 5 with the response).

To do this, the first select\_one asked for the category (eg 'which kind of school are you reporting on'), and then I calculate the question text & hint text (Q1, H1, Q2, H2 etc) as instance lookups in the choices sheet / CSV.

Then for ${Q1} the label value uses the calculated ${Q1\_text}, (in your case it might be a text question with label `please enter the details of ${Q1_text}`) and the choices come from the list Q1, with a choice filter for the category chosen to only show options relevant to the selected category.

If that sounds like something you are looking for and @iamnarendrasingh's answer doesn't suffice I can edit a form down to provide an example
