Validate (and populate) value of a question from from local database

Is the possible to store values in a local database and use values from that to validate entry in the form? For eg. we store IDs for participants a the local database, and at the time to entry, the ID field verifies the values from the local DB to ensure that no incorrect values are entered.

Similarly, is it possible to populate values of other fields in a form based on response to a question. For eg. if the ID is 507 for a participant, the values for 'gender', 'age' etc are automatically filled from the local DB.

Not at this time. We are working to offer capabilities similar to this, but
no timelines for it.

Mitch

··· On Wed, May 23, 2012 at 11:59 PM, wrote:

Is the possible to store values in a local database and use values from
that to validate entry in the form? For eg. we store IDs for participants a
the local database, and at the time to entry, the ID field verifies the
values from the local DB to ensure that no incorrect values are entered.

Similarly, is it possible to populate values of other fields in a form
based on response to a question. For eg. if the ID is 507 for a
participant, the values for 'gender', 'age' etc are automatically filled
from the local DB.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

Thank you so much for these pointers - Yaw and Mitch. I will look into it and if we get this to work with no issues, I will share the modifications here so that others needing the similar functionality can use it. Thanks again.

You can also check out this thread for more on alternatives to data
pre-loading. https://groups.google.com/group/opendatakit/browse_thread/thread/79185962779fafae

··· On Thu, May 24, 2012 at 9:20 AM, Mitch S wrote: > Not at this time. We are working to offer capabilities similar to this, but > no timelines for it. > > Mitch > > > On Wed, May 23, 2012 at 11:59 PM, wrote: >> >> Is the possible to store values in a local database and use values from >> that to validate entry in the form? For eg. we store IDs for participants a >> the local database, and at the time to entry, the ID field verifies the >> values from the local DB to ensure that no incorrect values are entered. >> >> Similarly, is it possible to populate values of other fields in a form >> based on response to a question. For eg. if the ID is 507 for a participant, >> the values for 'gender', 'age' etc are automatically filled from the local >> DB. >> > > > > -- > Mitch Sundt > Software Engineer > University of Washington > mitchellsundt@gmail.com

Have you made any progress with this that you could share with us? This is
something which would be much appreciated.

Cheers,
Paul.

Thanks Yaw. You mentioned in the other post that you have a rough idea of how to do this with external CSV files. This will work great for us. Can you please point me to the right direction where I can some details on how to achieve this?

Best,
Basant

I haven't thought about this deeply, but here goes.

In the same way you download multimedia files with Collect, you can
modify Aggregate and Collect to also include CSV files in the
download. Then on form load, create temporary SQLite DBs on the phone
from that CSV (or just load that into memory). Then have custom
widgets in Collect read from that DB and pull the correct values into
the form (or build a standalone app, like ODK Tables, and generate a
XML instance and pass that to ODK Collect to pre-fill the form).

··· On Thu, May 24, 2012 at 10:53 PM, wrote: > Thanks Yaw. You mentioned in the other post that you have a rough idea of how to do this with external CSV files. This will work great for us. Can you please point me to the right direction where I can some details on how to achieve this? > > Best, > Basant >

There is no modification required to ODK Aggregate or Collect to store or
download these files -- just upload the file to ODK Aggregate as a media
file, and download to your phone. At this instant, ODK Aggregate does not
allow you to overwrite these uploaded media files with newer versions.

I am working on incorporating Christopher Robert's work to allow you to
update forms with updated media files and question text, translations, etc.

I will be releasing ODK Aggregate 1.0.8 shortly (sometime next week), and,
shortly afterward, 1.1.0 will be released with the ability to update your
forms provided they don't have any structural changes (new questions, etc.).

The minor version update (from 1.0 to 1.1) indicates that once you upgrade
to 1.1.0, you may experience problems reverting to 1.0.x -- you can move
forward, but not backward.

Mitch

··· On Fri, May 25, 2012 at 8:12 AM, Yaw Anokwa wrote:

I haven't thought about this deeply, but here goes.

In the same way you download multimedia files with Collect, you can
modify Aggregate and Collect to also include CSV files in the
download. Then on form load, create temporary SQLite DBs on the phone
from that CSV (or just load that into memory). Then have custom
widgets in Collect read from that DB and pull the correct values into
the form (or build a standalone app, like ODK Tables, and generate a
XML instance and pass that to ODK Collect to pre-fill the form).

On Thu, May 24, 2012 at 10:53 PM, basant7@gmail.com wrote:

Thanks Yaw. You mentioned in the other post that you have a rough idea
of how to do this with external CSV files. This will work great for us. Can
you please point me to the right direction where I can some details on how
to achieve this?

Best,
Basant

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com