Using text responses in previous questions as options other question

I have the following questions in my form:

a) List the candidates that contested in a constituency
b) Who won the election?

I would like the names entered in question (a) to be options in question (b). Any help, please.

could you provide some more information, please:

  1. Are you using Enketo (web) or KoBoCollect?
  2. How do you get the list of candidates? By text type field in repeat loop?

A solution might be to define and populate dynamically labeled selection_one list, for the winner by using ${candidate01} etc as labels. With selected-at() you could calculate the candidate0X variables, which are referenced in the labels.
But I think, there are some limits:

  • You need a long placeholder list for the winner choice up to the maximum of candidates
  • Some of them will finally be with empty labels (no candidate) and you have to exclude those out when choosing the winner (e.g. by constraint)
  • If you use a choice_filter (e.g. to exclude empty names) the dynamic ${} might not work. But you may try with choice_filter as jr:choice-name(…) != ‘’ (i.e. empty candidate label)
    Kind regards
1 Like