-
-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "_id" field to Browse Form Data view #338
base: main
Are you sure you want to change the base?
Conversation
I would like to provide more background about why this patch can be very useful. In the initial stages of case management, often a new case will have no pre-existing identifier. Therefore, we must generate or assign an identifier that can be used to track this case. The UUID --- which is already exposed in the data view --- can be used for this purpose, but is far too long and clumsy for many applications. Alternatively, _id can be used as an identifier unique to this form. When quality control staff review data submitted to this form, they can then extract this _id identifier from the data view thanks to this patch. |
We are not planning to continue using the
I don't think we will want to merge this change into master because UUID would be more future proof. I'd like to note: in upcoming features (in kobotoolbox/kpi and kobotoolbox/formpack repositories), we have decided to use a new index that says "this is the nth submission for this form" because, as you noted, uuid is quite clumsy. This value was originally going to be gleaned from the index of the database query, but it might also make sense to store this value in a column of its own. |
But the UUID changes when the submission is edited, doesn't it? Which makes
it not really ideal as an identifier for the use case mentioned above.
It will be stored as deprecatedID but the original UUID will be lost after
the second edit to a submission if I understand it correctly.
So great to hear that the _nth submission_ counter is going to be
introduced.
|
Thanks for the quick reply @dorey. A few comments:
Some questions:
After replying to our questions, we may close this PR. |
Thanks @jeverling . I had forgotten that UUID changes on save. I don't think this was by design, so I will bring this up for discussion as something to be fixed in coming months. |
|
If exposing Not that i'm pushing to merge this change, just discussing the concept. |
Yes. On the other hand, because of the maintainability issues with the Kobocat repo, all the kobocat URLs might be phased out in the coming months once the features are ported over to KPI. (It will truly be a "legacy" interface that will stop receiving newly deployed projects). |
This adds _id field to "Browse Form Data" view's table (
/<username>/forms/<form-id>/instance#/<submission-no>
)I'm not sure about whether this patch's quality is appropriate (as the column is essentially hardcoded in the js source). Let me know if there's a nicer place to put that in.