Dynamically change multiple select options based on another form's submissions

What is the problem? Please be detailed.
My use case is this - We have one 'Enrollment form' which is being used to enroll children in an NGO's creches. The results from these submissions are being aggregated on an ODK Aggregate instance hosted on Google cloud. We're looking to create another simple 'Attendance form' which has a multiple select question which will dynamically pull the names of enrolled children into the form for their daily attendance, 'present' or 'absent'. Hence if a new child joins the creche mid-month the attendance form should automatically reflect their name once enrolled.

What ODK tool and version are you using? And on what device and operating system version?
Using ODK Aggregate, and the form submissions are also being published to Google sheets. ODK Collect is being used on Android tabs to collect data.

What steps can we take to reproduce the problem?
Do let me know if sending sample data and forms will help with this question, but to my knowledge its a generic issue, not specific to any particular form.

What you have you tried to fix the problem?
Scanning through the forums and xlsform.org. This question is quite similar to my query.

It appears that the only way to have external options is through a csv file that has to be uploaded to ODK Aggregate. You can't access select options from other form submissions. Even with this csv file if one needs to change the select options it has to be done manually and secondly the form version number has to also be manually changed. Am I right in understanding this?

What alternatives do I have since updating these forms manually on a daily basis is not feasible.

1 Like

After a little more reading it seems as though this task would require some code to be written
I'm imagining a sequence of steps that goes like this

  • script on Google Cloud recognizes that a new submission has been made using the Enrolment Form
  • script pulls in the new submission and creates a new external csv for the multiple select choices in the Attendance form
  • this new csv is now uploaded to Aggregate
  • the Attendance form would also need to have its version number changed so that ODK Collect recognizes that some changes have been made.

Please advise on whether this approach makes sense?
Also in terms of the code that has to be written, some guidance would be useful.
I am reasonably familiar with python, but not very familiar with deploying code to run on Google Cloud.

Hello Craig, I'm having the same question. I'm trying this out with Google Sheet instead ODK Aggregate and your sequence of steps makes sense to me. Create a Google Script that triggers a new row on a CSV, and use this CSV for data preloading. I still haven't found how to capture the event on Google Sheet, simple onEdit() script doesn't seems to work. Have you made an advance on this?