OK, new try of summarizing / setting a new focus:
I tried to achieve the following WITHOUT external file, but couldn’t find some kind of a lookup approach (if you have an idea, please let me know). Therefore I resorted to pulldata, but somehow it doesn’t work – even though I have found a tutorial which describes exactly what I am trying here: https://www.youtube.com/watch?v=-Hi_K1rWxCo&t=36s (I am using the kobotoolbox app and server).
Objective: I have four levels, namely provinces, districts, learning clusters, schools. Three of them are part of a cascading select series of questions: province, district, school. While learning clusters are logically between district and school (i.e. a district has a number of learning clusters and a learning cluster includes a number of schools), I don’t want to ask to select the learning cluster BEFORE the school – but the other way round: After selecting the district, the school name should be selected (which works well), and THEN the respective learning group should be calculated/shown.
With other words: I have a number of schools, of which always two or three belong to a cluster. After the school name has been selected, the respective cluster name (or cluster ID) should be presented just for information.
Here is what I tried, but while school name is shown, the next step just says: “Learning group is” (so the cluster doesn’t seem to be calculated properly).
SURVEY tab
type name label calculation
select_one schools school_name Name of school:
calculate clustercalc pulldata(‘odktestschoollist’,‘cluster’,‘fac_name’,${school_name})
note test_note School Name is ${school_name}
note lg_note Learning group is ${clustercalc}
CHOICES tab
list_name name label
schools school_llcl1 Arandis Primary School
schools school_llcl2 U. B. Dax Primary School
schools school_llcl3 Ebenhaeser Primary School
schools school_llcl4 Elifas #Goseb Primary School
schools school_llcl5 Erongosig Primary School
CSV file (name: odktestschoollist.csv)
fac_name cluster
school_llcl1 NA.ER.AR.001
school_llcl2 NA.ER.AR.002
school_llcl3 NA.ER.KA.001
school_llcl4 NA.ER.KA.001
school_llcl5 NA.ER.KA.002
centre_llcl1 NA.ER.AR.001
centre_llcl2 NA.ER.AR.001
centre_llcl3 NA.ER.AR.002
centre_llcl4 NA.ER.AR.002
centre_llcl5 NA.ER.KA.001
centre_llcl6 NA.ER.KA.001
centre_llcl7 NA.ER.KA.002
Lookup_test.xlsx (14.6 KB) odktestschoollist.csv (342 Bytes)
Any idea what is wrong? Or even an idea to do a lookup WITHIN the choices tab?