I'd like to share a technique to perform basic phone configuration checks within an ODK form. I've learned this from one of our partner organizations, and it seemed so broadly useful that I'm taking the liberty to share it here.
The idea is to add a set of configuration checks at the beginning of a form, like this:
type | name | label::English (en) | required | relevant |
---|---|---|---|---|
start | start | Start of Survey | ||
end | end | End of Survey | ||
username | username | Enumerator User Name | ||
deviceid | deviceid | Device ID | ||
phonenumber | phonenumber | Enumerator Phone Number | ||
begin_group | group_check_constraints | Checking phone configuration | ||
note | note_missing_username |
![]() |
yes | normalize-space(${username}) = '' or ${username} ='NULL' or ${username} = NULL |
note | note_missing_phone_number |
![]() |
yes | normalize-space(${phonenumber}) = '' or ${phonenumber} ='NULL' or ${phonenumber} = NULL |
note | note_incorrect_date_and_time |
![]() |
yes | date(today()) < date('2022-06-01') |
end_group |
These checks will not allow data collection to proceed unless the phone configuration satisfies certain minimal constraints.
The attached file contains a more complete example, with hints that explain how the problems can be fixed.
odk-configuration-checks.xlsx (11.5 KB)