Is there any way to update the select option values of a form without replacing the whole form?

Hello Everyone,

I have a form for daily home visit for the patients under community-based treatment. Challenge is, the patient list should be dynamic as new patients will be enrolled for treatment and some patient will get cure/die/readmitted to hospital/lost to follow up etc. Is there any trick to manage some values.

Thanks,
Imran

Good news -- no tricks are needed!

https://docs.opendatakit.org/form-update/ describes how Aggregate handles form updates. If you're using an external file for your patient data, you can upload the exact same version of a form and the new data file each time you need to change the list. If you're embedding the patient data in the form, you can change the form version and re-upload it.

On the Collect side, enumerators will need to make sure they always have the latest form version. If they go to Get Blank Form, they'll see a message that indicates a form update is available and can download that one.

You can also set up Collect to auto update forms. To do that, go to General Settings > Form management, set periodic form updates to a certain time interval and enable automatic downloads. I would still recommend that the enumerators check Get Blank Form to make sure they have the latest version.

Note that for this kind of setup to work well, you really need to make sure enumerators can have access to an Internet connection periodically to ensure they have the correct version of the form. Something you may want to do is always increase the form version and send it as part of the submission. You can see Can the form version be accessed from inside the form? - #4 by LN for how. That way you can be sure that each enumerator is updating as expected.

3 Likes

Thanks so much, @LN. This is a lifesaving tip. Just another query as you mentioned external file, performance wise, is there any big difference between using an external file or embedding patient information within the form?

Thanks again,
Imran

1 Like

It's a little hard to predict at how many records you'll start feeling the difference because it is device-dependent. That is, a more performant device may not feel any slower with internal items before you get to tens of thousands of records but a less performant device may feel slower at several hundred records. I like to try internal selects first with the device I plan to use and then decide.

1 Like

Thanks, @LN. That's very helpful.

Imran

1 Like

Hi Helen,

Some question regarding this form. Is there any way to display information based on my selection. For example, I have 4 patient A B C and D. If I select A, I need to display address, dob etc. on screen. Is there a way to retrieve that information from the choices page. And secondly, for each patient, the list of drugs are different, is there any option to pull up different select list for different patient?

Thanks,
Imran

Yes, you can include arbitrary data sets in the choices sheet and query them. Currently the XLSForm support for that is not so good so the structure is a bit odd. This form shows the approach. You can read the comments for explanations. There's also another example I described at Progress out of Poverty Index (PPI) tools - #14 by LN.

search() and pulldata() let you pull values from arbitrary CSVs but I don't personally use those because they're not part of the official specification. You may want to read more at http://xlsform.org/en/#dynamic-selects-from-pre-loaded-data.

1 Like

Dear @LN ,

This is a great help and exactly this is what I was looking for. Of course, this is something advanced and will be helpful in many of my forms I am working on.

Thank so much once again,
Imran

1 Like