Can I check automatically if a form is being populated via KoboCollect or an Enketo web form?

Is it possible to check automatically within a given form whether a user is populating the form using KoboCollect or a web form, i.e. can I generate a relevant condition like ${form_filled_through}="KoboCollect" or ${form_filled_through}="Enketo" that the user does not have to self-select?

The reason I’m asking is that I’d like to style choice labels (using CSS colors). However, styled choices aren’t interpreted on Enketo and the web form will show the HTML syntax - which is distracting.

Therefore, I would like to be able to serve questions depending on whether the user works in KoboCollect or a web form, so I can show styled vs. non-styled choices.

Thanks for any pointers you might be able to give!

1 Like

Hi @cgros,

I think you could do this by using “deviceid” meta data question, where the value of this question will be like this when you are using Enketo:
ee.kobotoolbox.org:XXXXXXXXXXXXXXXXX or
ee.humanitarianresponse.info:XXXXXXXXXXXXXXXXX
So any value start with “ee.” means using Enketo
Kindly have a look at the example:


KOBO Collect VS Enketo.xlsx (11.2 KB)
Let me know if you need more help.
Best,
Yasser

2 Likes

Hello,
See also
https://community.kobotoolbox.org/t/device-id-metadata/10605/2

Take attention that there will be changes for Android (and Collect)
https://forum.getodk.org/t/collect-will-need-to-stop-using-sdcard-odk-for-files/24159

2 Likes

Thank you @Ysr3322 for your helpful response, this is a great solution.

Thanks also to @wroos for the heads-up that this solution will not work anymore as of this fall!

Any ideas for alternative solutions even if the device ID is not accessible anymore?

Thanks!

Hi @cgros
On this issue, and as noted in the link that @wroos shared, the security concerns and data confidentiality as a whole beats the need to have the device ID collected. The only other plausible approach to knowing whether someone used a web-browser or a collect application would be to either

  1. Have deployments for the web different than deployment for collect (this means that you have two different projects). Maybe cumbersome if you need to have the data merged within the KoBoToolbox platform.
  2. Adding a direct question to the user to indicate whether they are using the collect application or a web-browser to respond to the survey.

We can, however, leave this open to see if other users have alternative approaches towards getting this done.
Stephane

2 Likes