I would like to select items/choices with select_multiple.
If more than one option was selected in the select_multiple, then a subsequent question (rank widget) should appear to rank the selected choices in the select_multiple question.
How can I do this?
Thank you!
With this I can make the rank question appear when more than one option is selected, by including all the possible combinations.
Do you also know I can only include the selected options in the rank question?
Hie Svenja How can you only include only the selected options in the rank question?
You can filter rank
choices the same way you filter select_one
or select_multiple
choices! In your XLSForm, write a choice_filter
for the rank
question. This filter should only match options which were selected in the select_multiple
question. You can use the selected
function for this. It will look something like selected(${your-select-q}, name)
. name
refers to the name
column in the choices
sheet.
Please see this sample form for a working example.
The choice_filter was working for us before but since we upgraded odk central to v2023.2.0 the rank widget does not allow to move the answers anymore when a choice_filter is applied, both in enketo webform and in the odk collect app. I tried the sample form posted here and the problem also happens with it. It shows the relevant options, but ranking is not possible.
Hi @tei_aqysta
Welcome to the ODK forum. We're glad you're here. When you get a chance, please introduce yourself on this forum thread.
What do you mean by that? Do you see the options but can't move them or what?
Hello @Grzesiek2010 Alright, I introduced myself.
Indeed, when a choice filter is applied to my rank type questions, I cannot move the answer options when filling out the form (both in web and in odk collect app) to put them in a different order to rank them.
This is the example form posted above (in enketo web) with choice filter applied to the rank type question:
You dont see the typical 4 dots of a rank type questions, and I cannot move them to change the order.
And this is the same form, but without the choice filter applied to the rank question:
Here you do see the 4 dots, and I can move them to rank them
When it comes to Enketo it doesn't work indeed Rank widget not working in Enketo but in ODK Collect everything seems to be fine. What version of ODK Collect are you using?
Hi @Grzesiek2010 ,
My apologies I now see that it does work indeed in ODK collect, I was not holding it long enough. However, we use it mainly with enketo and it did work there as well, before we did the upgrade of odk central.
Ok as I aid above it is broken in enketo indeed. You can track the changes here https://github.com/enketo/enketo-core/issues/981