Querying saved data in ODK Collect and Aggregate

Hi ODK Devs,

I have a unique requirement for our form that requires to query national-id
number of a person to check if one was registered with us before. Querying
values from active instance of the form is not problem, but how can we go
about querying data earlier saved on device or ODK Aggregate?

Few theoretical solutions that i came up with:

  1. Export CSV file from ODK aggregate, put it in ODK directory and try
    querying old data from there.

  2. Put national-id values into SQLite DB and put it in ODK directory and
    then query old data.

I am sure someone would have came across this problem before, any input on
this would be really appreciated.

Regards,
Ayub

2 Likes

Hi Ayub,

SurveyCTO's version of Collect allows for .csv files to be attached to
forms, so that you can query them as part of your XLSForm. We haven't
released the source for that, though, so it wouldn't work for you if you're
trying to customize Collect yourself.

Also, our solution doesn't update dynamically, so if you register somebody
on one tablet, another tablet won't suddenly start seeing that person as
already registered. For that, you'd need to look into ODK Tables and/or
some of the other ODK 2.0 tools (currently in beta).

Best,

Chris

ยทยทยท On Wed, Dec 11, 2013 at 12:46 AM, Ayub wrote:

Hi ODK Devs,

I have a unique requirement for our form that requires to query
national-id number of a person to check if one was registered with us
before. Querying values from active instance of the form is not problem,
but how can we go about querying data earlier saved on device or ODK
Aggregate?

Few theoretical solutions that i came up with:

  1. Export CSV file from ODK aggregate, put it in ODK directory and try
    querying old data from there.

  2. Put national-id values into SQLite DB and put it in ODK directory and
    then query old data.

I am sure someone would have came across this problem before, any input on
this would be really appreciated.

Regards,
Ayub

--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi Chris,

ODK collect and XFroms (hand coded) are currently we are working with,
wondering if we can do this in ODK version of collect. I came across this
URL: http://opendatakit.org/help/form-design/external-itemsets/

For instance, at the end of data collection day, send forms to Aggregate,
export .csv file and give that to each enumerator device and from there
query if someone is already registered or not.

From above URL:


county

I think it maybe possible to query CSV and store that in a readonly input.
After that we can check if it has some value, if it does, stop leading form
questions.

Do you think its a good way to proceed?

Regards,
Ayub

I tried itemsets example listed here:
http://opendatakit.org/help/form-design/external-itemsets/ Placed files in
correct directory (querynid-media\itemsets.csv), placed a query for '111'
but i didn't got the name returned. Here is how i did it:

NID NID Name

Can anyone please see what i am doing wrong?

Regards,
Ayub

itemsets.csv (55 Bytes)

querynid.xml (1.08 KB)

Yaw , Mitch, Chris? anyone? : ) still stuck on it. However external
itemsets example form is working fine on the device.

Regards,
Ayub

Sorry, Ayub, I am not familiar enough with this feature. My sense is that
it wasn't designed for your particular use case.

More generally, you seem to be trying to do a number of fairly advanced
things in a pretty short period of time; you've posted a number of queries
in the past few days. I can continue to help with respect to richer
integration with external apps (offline), Mitch and Yaw can continue to
help with other things -- but it may be difficult to get rapid support on
your full range of activities. You might consider hiring Nafundi or another
consulting team to provide a more intense and dedicated level of support to
your project. (Just an idea.)

Best,

Chris

ยทยทยท On Dec 12, 2013 5:35 AM, "Ayub" wrote:

Yaw , Mitch, Chris? anyone? : ) still stuck on it. However external
itemsets example form is working fine on the device.

Regards,
Ayub

--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi Chris,

Thanks for your response, its just that most of the work is done on our
forms and only some (but key requirements nonetheless) are left to work
with. Meanwhile i will keep posted about this issue when i get it to work.

Regards,
Ayub

P.S: Hiring a dedicated consulting is a good idea :slight_smile:

Got it working ! i had an issue where completely validated form gave out an
error (no information about it in collect, however in ADB it is something
about creating structures in sqlite ...).

Reasons being multiple Blank form instances in ODK collect (however being
only 1 form file in \form directory). Deleted all forms in Blank Forms
section, pasted form again in SDCARD and scanned again, it worked. (Possibly
ODK Collect Bug).

Attached form and csv gives out name against a number. Hope this helps
other new members.

Regards,
Ayub

persons.xml (1.09 KB)

itemsets.csv (92 Bytes)