Is it possible to populate a Multiple Choice Lookup Table question from a case property holding a space-separated list in CommCare

commcare

I have a list of villages saved to the case as a space separated list. In my form, I want the user to be able to choose a village from this list, but I can't figure out how to set up the Multiple Choice Lookup Table question.

I feel like the fact that the below question has an answer should mean that mine has an answer, but it's not clear to me how to extend it.

Is it possible to use a repeat group to iterate over a space-separated list?

Best Answer

You could accomplish this workflow by creating a model iteration repeat using the space separated list (which is what is outlined in the previous question) before the multiple choice question, then using the repeats in the list as the input elements to the multiple choice question.

When using Model Iteration repeats in this fashion, you'll need to include at least one non-hidden-value question in the repeat (you can set its display condition to false()) so the repeat "unrolls" before the multiple choice question in populated.