Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

Deleted fields missing from submissions csv #96

Open
LeaTark opened this issue Mar 10, 2017 · 1 comment
Open

Deleted fields missing from submissions csv #96

LeaTark opened this issue Mar 10, 2017 · 1 comment

Comments

@LeaTark
Copy link

LeaTark commented Mar 10, 2017

It looks like the columns in the csv are created from the fields currently in a form rather than the submissions. This can be a problem when a field is deleted.

Even though the data is still in the submissions list, deleted fields are not exported to csv.

If a field is no longer required in a form, I'd like to be able to delete it and not have it in future submissions but not lose access to data currently gathered.

@LeaTark LeaTark changed the title Deleted fields missing from csv Deleted fields missing from submissions csv Mar 10, 2017
@Nicholas-Westby
Copy link
Contributor

Thanks for the report!

If anybody wants to tackle this, here's the code that is writing the header fields for the CSV:

The tricky bit is that you'll have to read in all the stored submission records to figure out the "extra" fields (i.e., the fields that no longer exist in the current form).

After you write out the headers, you'll also have to write out the values, which is currently done here:

You'll need to write out a dummy value for any submissions missing some of the fields (which is likely to be the case on newer submissions, since newer submissions wouldn't contain any of the deleted fields).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants