You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Sometimes in a form you want to allow the user to select from very large set of choices. Currently, the only way to do this is by adding all the choices to the choices tab (aka the "internal" dataset).
This approach does not scale well for a number of reasons:
It can be hard to maintain the list of data, particularly keeping the data in sync across multiple different forms that use the same dataset.
The xlsx files can become large and unwieldy to edit
The form xml file produced by cht-conf is very large and cht-conf's form validation logic will not perform well.
Describe the solution you'd like
Enketo supports a select_*_from_file question type that allows for specifying that the data to select from is coming from an external dataset. We should add support to the CHT for this question type. External data files could be uploaded to the server as attachments on the form doc and then injected into the form model when initializing the Enketo form.
Describe alternatives you've considered
I did spend some time exploring the possibility of using the extension-libs to do something here. Unfortunately, the intricacies/functionality of select_* questions are so closely integrated with the Enekto form lifecycle (which requires that the form-model data be completely initialized when creating the form that I could not find any feasible approach from that angle.
Additional context
The select_*_from_file question type basically causes the select widget to look for an external instance in the form model. We are already adding an external instance to forms containing contact-summary data. I think it should be fairly straightforward to extend this code to include more xml instances in the options.external list that gets passed to the EnketoForm constructor.
The MVP here would seem to be including an xml file that exists as an attachment to the form doc. For completeness, this would also probably include changes in cht-conf and the api server to upload/save the attachment to the doc.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Sometimes in a form you want to allow the user to select from very large set of choices. Currently, the only way to do this is by adding all the choices to the
choices
tab (aka the "internal" dataset).This approach does not scale well for a number of reasons:
xlsx
files can become large and unwieldy to editxml
file produced by cht-conf is very large and cht-conf's form validation logic will not perform well.Describe the solution you'd like
Enketo supports a
select_*_from_file
question type that allows for specifying that the data to select from is coming from an external dataset. We should add support to the CHT for this question type. External data files could be uploaded to the server as attachments on the form doc and then injected into the form model when initializing the Enketo form.Describe alternatives you've considered
I did spend some time exploring the possibility of using the
extension-libs
to do something here. Unfortunately, the intricacies/functionality ofselect_*
questions are so closely integrated with the Enekto form lifecycle (which requires that the form-model data be completely initialized when creating the form that I could not find any feasible approach from that angle.Additional context
The
select_*_from_file
question type basically causes the select widget to look for an externalinstance
in the form model. We are already adding an externalinstance
to forms containing contact-summary data. I think it should be fairly straightforward to extend this code to include more xml instances in theoptions.external
list that gets passed to theEnketoForm
constructor.The MVP here would seem to be including an xml file that exists as an attachment to the form doc. For completeness, this would also probably include changes in cht-conf and the api server to upload/save the attachment to the doc.
The text was updated successfully, but these errors were encountered: