1. What is the general goal of the feature?
To use the select_one ${from_repeat}
feature, but being able to specify two different questions within the same repeat as value
/name
and label
. Currently the ${from_repeat}
repeat question is used as both name
and label
.
2. What are some example use cases for this feature?
Household questionnaire:
- Repeat group (household roster)
- member_name
- Auto-generated unique ID
....
- Select_one ${member_name} - choose the main beneficiary / head of household
This set-up is useful to be able to apply a choice filter on the household members that can e.g. be selected as main beneficiary. The member names are displayed as labels which is great, but the value stored is also a member name. With an option to specify different labels and names, this select_one could instead save that member's unique ID.
This would save having to transform the data after collection. It also helps avoid errors due to different people having the same name (e.g. across households), or different project sites having similar names (across different administrative regions), etc. and seems generally better practice.
An added benefit might be allowing select_multiple
from repeat, as a form could have:
- Repeat group
- Text input for "Full Name" with spaces
- Calculate field transforming to "full_name" with underscores
This would mean the output of the select_multiple (space separated array) would not have errors from spaces in the names.
3. What can you contribute to making this feature a reality?
Possible suggestion on how to show in XLSform: I don't know if the parameters
tab could allow for value=../name_field
or label=../label_field
or even alternatively label='label_field'
with a constraint that it had to be a node at the same level as the initial select_one ${repeat_question}
?
I haven't yet contributed to pyxform but would be happy to have a go to get started if helpful. I confirmed at this line of question.py that the same node was being used for value and label