REST API, GET existing data with barcode/QR code

How dynamic is this scenario? That is, do you have some basic data about the asset represented by the QR code that you need to update once or are there lots of folks that may be updating information about the asset at any given moment?

The part that ODK can't do is automatically creating an updated dataset. This means that the more dynamic the scenario, the more difficult it would be to address with stock ODK tools. This ties in to the issues and possible changes described in ODK ecosystem entity-based data collection table of contents.

The basic concept you can use today is to attach a data file to the form definition that has values associated with each asset. These would be indexed by the code you have in the QR code. Collect would use the QR code value to look up the asset row and populate fields based on those values. Then the user could modify them as needed and submit the form. If further updates are possible, you'd need to update the data file with the new values. You could automate this by pulling all records from Central, building the data file with the latest values for each asset, and uploading it as an update to the form. You can have Collect automatically fetch form updates at some configured frequency.

Where things get messy is if you can have multiple people updating the asset data, especially while offline. For example, Person 1 scans the asset, fills in some data. Person 2 scans the asset and doesn't get the update from Person 1 but also makes some updates. Now Person 2 submits. Later Person 1 submits. You'd need to reconcile those.

1 Like