Linking QR code to facility ID code

Hi there!

I wanted to know how to link each site-specific QR code with an ID code. So we want all the sites participating in our study to receive a site-specific QR code which they will scan in order to do their data entry - and I want to link each of these QR codes to a facility ID code which I will assign to each site.

Furthermore, I have three forms in my study, and the first field in each form will be the facility ID code. Ideally, I would like to have this field auto populated. So, when the QR code is scanned at each site, the facility ID code field will auto fill in all the forms that are completed that day, at that site.

Is this possible?

Thanks in advance!

It should be possible to accomplish what you are asking. Have you read through the section of the docs on data collector workflows? It describes some strategies for this.

To add to @danbjoseph's recommendation, I would customize the QR codes to set the facility ID as the form metadata username. You can do this manually by scanning the code into Collect, manually setting the username by going to Settings > User and device identity > Form metadata, and then sharing the code back out from the device from Project management > Reconfigure with QR code > QR Code (you can use the share icon to share a file. Note that this flow is not as intuitive as it should be).

Alternately, you can script the QR code generation. There are a few examples of that on the forum and one using Python at https://github.com/getodk/pyodk/tree/master/examples#app-user-provisioning-script

Add a username field to your form as described in the metadata docs and that value will be pulled in.

For the interested, you can see a more complex example of using form metadata as a way to confiugre a form from @mathieubossaert in his post at ODK to collect species and habitats localities, as pressure and threats to ecosystems

2 Likes

Hi @danbjoseph @LN

Thank you very much for your suggestions. This is probably quite basic but I am currently setting up a new device - how do I go about testing the site QR code whilst still in draft mode? @LN I followed the steps you suggested above, but I think as the forms are still in draft mode, when I go into 'fill blank form' in the app on said device, it says 'nothing available to display'.

Thanks!

Faran

This is an excellent question -- we don't currently have a great answer for this and it's something we've been thinking about quite a bit recently.

There are two things you need to verify: that the QR code you've made correctly sets the username and that the form you've designed correctly uses the username. For now you need to verify those separately.

It sounds like you've scanned in the QR code with the username set. Now you can verify it by going to Settings > User and device identity > Form metadata and checking that the name is correctly set. If so, your QR code is ready to be used.

Then to verify the form, you can scan in the draft QR code, manually set the username in Settings > User and device identity > Form metadata for that draft project in Collect and verify that the form does what you wish. Once you're satisfied with your form design and your field data collection is ready to start, you can publish the form and it will be available to anyone who has a Collect project configured using the App User code.

What I've described above is what I'd recommend for a form designer verifying a form and configuration. There's a related issue of having field staff try out forms and a device configuration for offering feedback or training. If this is what you're asking about, it would be helpful to get more details on your ideal workflow. Two strategies I've seen used to good effect are to include a practice/real question at the beginning of the form so that practice submissions can be rejected and creating a separate App User with the same config used for practice and then revoked.

We know it's common to want to test multiple forms together or as in your case to verify an App User's configuration along with one or more forms. We're exploring how we could add a draft project concept without adding too much complexity and room for error.

2 Likes