Retrieving data submitted with previous form definitions?

Hello,

I am trying to download submissions according to an earlier form definition; or even to download "raw" submissions (free from a form definition) according to a suggestion I read on this thread: Can you still send data from old versions of forms to ODK central - #5 by LN

My use case is as follows: I am running a piloting phase where I split a survey into two forms. I wanted to pilot one section heavily so put it on both forms. Then, I removed the section from a later version of one of the forms to get my fieldworkers running both surveys. Now, I'd like to access the data from the section I deleted.

I've read that deleted variables should be preserved on ODK Central, but will not download using OData or the .csv export tool because it runs submissions through the XLS form prior to submission.

Is there any way to get that data, or should I consider it lost?

I've been using ruODK and OData to pull submissions, but am open to manually downloading forms if need be.

Hi @lauresp,

This seems to be a limitation / feature of ODK Collect. ruODK only returns the data originally handed out by Central.

I'm lagging a bit behind the newer API endpoints supporting form versioning, maybe there's a way of retrieving submissions to an older form version?

Not helpful in your situation, but you could handle your use case as two separate forms in the future, and through managed QR codes and form access settings control from within Central who gets which forms.

Have you got earlier downloads of submission data that contain the now deleted fields?

Last idea, you could use @mathieubossaert 's postgres scripts to extract submission data from the database directly, which bypasses Central's logic layer.

@Florian_May I think you mention my first tests but since then my PotgreSQL functions "simply" transform API json results to database tables.

Maybe this topic ciuld helo : Can you still send data from old versions of forms to ODK central - #4 by mathieubossaert

1 Like

Hi @Florian_May, @mathieubossaert,

What I learned is that all data is stored in ODK Central, regardless of whether the fields are included in the latest form definition. However, when you export, the data is passed through the latest form definition and only matching fields are pulled.

@yanokwa pointed out in a workaround for retrieving data from deleted fields in another thread. It worked for me in this case, and didn't require me to write any new scripts :relaxed:. You basically just need to upload a new form definition that re-includes the deleted fields, and set relevant as false() to hide the questions from data collectors:

2 Likes