The challenge with search()
/pulldata
is that because it exists outside of the ODK form specification and the form evaluation engine, general implementations for new features like dynamic defaults typically won't work with it.
Is the primary problem that you need to solve that you need to use external data files? If so, perhaps you could use the standards-compliant external secondary instances with select_one_from_file
. There are some loose ends to the implementation including support for multilingual labels, performance improvements and documentation. If you are using modern devices and your lists have thousands of elements or fewer, it will likely work well for you. Defaults, choice filters and lookups work the same way as with choice lists built into the form.
The least familiar part will probably be querying which uses XPath syntax. For example, to get the label
from the facilities
dataset: instance('facilities')/root/item[name=${a1_2}]/label
.
select_from_file.zip (23.2 KB)