What is the general goal of the feature?
The ability to set arbitrary key-value pairs under the Form Metadata area in General Settings, and then to access those values in forms via jr:preload or meta elements.
These custom values should be included in the 2D barcode.
What are some example use cases for this feature?
Our client wants to be able to set a Team Number field on devices, with that number being included in a unique identifier that gets generated for a given survey respondent. They want to avoid having the user entering the number every time to improve data quality.
There is already the Username field and we could use that (and probably will for now), but it feels a bit hacky.
Furthermore, now that the three 'user defined' fields have been decoupled from Server Settings (great!), they all of a sudden seem a bit arbitrary. Why are we privileging these three data types (username, phone, email)? The answer I think is historical, but I suggest we could transform that section to be fully user definable, perhaps with the existing three fields as 'suggestions' that you could delete if you don't want to use them.
We could also perhaps change the labels to the actual keys (userID, phoneNumber, email) and enforce some format restrictions on keys so that new user-defined ones use that style.
And it would also be nice to allow using the camelCase meta tag names (userID, simSerial, phoneNumber etc.) as
jr:preloadParams. We'd have to still support the old ones obviously, but is there a reason this can't be added? Maybe even allow instanceID, timeStart, and timeEnd as values for
jr:preload set to
property and slowly deprecate the
jr:preload field altogether? I don't understand why the two of them exist separately.
If this were in place, I think it might solve a bunch of needs folks might have around carrying data across form instances. e.g. Imagine an enumerator is going to survey 50 houses in a given town today, then 50 in another town tomorrow, they could set the town name in Metadata at the start of the day instead of entering it every time.
Another idea that has been floated is remembering the last answer and setting it as the default. I think this would also be a useful tool in the toolkit. We also needed this feature and ended up using an external app (thanks to @Grzesiek2010) as there was a fair amount of pushback on building that feature into ODK for reasons I can't remember. Also in that case it is numerical data, and we are were doing stuff like incrementing the number, so an external app seems more justifiable. But if it's just remembering the last answer, that seems like overkill. So I'd still like to see this make it in some day too.
But I think both approaches (remember last answer and custom metadata) would be useful depending on the situation. Imagine for instance if you have a team that is pre-configuring devices for folks before they head out. They could setup certain metadata values and verify them to be correct, and the enumerators might not ever need to touch them. This could be important for data quality.
The other consideration is that we already have a mechanism and a clear precedent for preloading form metadata. All we'd be doing here is extending the XForms spec a bit to allow arbitrary key value pairs.
Finally, if we do this, It might also be nice to move 'Form Metadata' to the top level of settings to allow easier access. There is plenty of room on that screen now
What can you contribute to making this feature a reality?
Probably a good amount. But first need to hear if others think this makes sense.
Thanks for listening!