Dear Bryant,
We don't provide detailed instructions about this feature because it's not supported officially. In the new platform, Arena, it has been replaced by the use of a Category (that corresponds to the Code List in Collect) with additional "extra" properties.
In case you want to use the idm:lookup function, here is what you have to do:
- open the database file (collect.db) with a SQLite database client (for example SQLite browser or use the client you prefer).
- add your table to the database with a structure similar to the following one:
CREATE TABLE "my_lookup_table" (
"id" INTEGER,
"key_1" INTEGER,
"key_2" VARCHAR,
"value" VARCHAR,
PRIMARY KEY("id")
);
It's important that the table has a column "id" and this must be the primary key of the table.
The other columns can be named in the way you want, and there is no limitation to their number, but the type must be only CHAR, VARCHAR, INTEGER or FLOAT.
- once the table is created into the database, fill it with values
- test that the lookup function works in the survey preview. In our example the expression you have to use will be something like this: idm:lookup('my_lookup_table', 'value', 'key_1', attribute_1, 'key_2', attribute_2) where attribute_1 and attribute_2 are the attributes defined in your survey. Instead of the "dynamic" value of the attributes in your survey, you can use even constant values, idm:lookup('my_lookup_table', 'value', 'key_1', 10, 'key_2', 'abc')
- if everything works in the preview, export the survey to Collect Mobile format and create the same table into the collect.db file inside the generated collect-mobile file (that is actually a zip file)
- test that everything works in Collect Mobile too
Please let us know if you need further support from our side, many thanks.
Open Foris Team