Changing the CSV file dynamically

Greetings all,

I want to change the content in the CSV dynamically without deleting the form or re uploading CSV . If i have 5 options in the CSV related to a question , I want to increase/decrease the options and it should show in the form when i open the form . I tried it by modifying the CSV which is downloaded from the server but the changes are not shown in the form . When i select the folder which has the form xml and media files downloaded i saw 3 files in the media section , one with '.csv.imported' extension , one '.db' extension and other '.db-journal' extension . I have modified the file having '.csv.imported' extension ,but there was no effect shown in the form . If i want the changes to be shown in the form which file i have to modify .

Thank you in advance,

SGSC.

Hi SGSC,
Do you mean you use csv file as a data store ?

Best regards

Ya !. For fetching the options for a question .

Thanks and Regards,

SGSC

Hi SGSC,
I am sorry for my late respince, i have to charge my labtop.

You can use filter in choices sheet,

Dynamically-Loaded Multiple-Choice Data
:point_down:
https://opendatakit.org/help/form-design/data-preloading/

Best regards

1 Like

Ya . Got it . Thank you for the response :slightly_smiling_face::slightly_smiling_face:

Regards ,
SGSC

You are welcome SGSC,

Best Regards

Pre-loading can help, but that feature is really designed for baseline/followup style scenarios where you can re-upload the CSV. I think what you want needs to be more dynamic than that (and perhaps real time and offline?)

How are you (@SGSC) hoping to add/remove values in the CSV? Do you have an app on the phone that'll do that? Do you want to the user to do that by filling in a question?

Also, the more we can understand about the high-level problem you are trying to solve, the better! Can you describe the scenario you need this feature for a bit more?

1 Like

Actually we wanted to assign some data for collection of information with respect to a particular day on a TAB . So we wanted to update the CSV from the file manager where it is stored, daily without uploading it to the server and again downloading it . When we went to the file manager to edit the CSV , we have seen three extensions as i have mentioned in the question . We have updated the info of '.csv.imported' extension file . But , it is not shown in the Run time . So i wanted to know how we can do that . And as you mentioned in the reply we were trying to do it dynamically in real time . Like , for suppose he has completed the collection of data and requires more data for further collection we need to send him the data dynamically . We need to push the data dynamically from our side into the CSV he has on his TAB and he has to see it . Could that be possible?.

Thanks and Regards,
SGSC.

This sort of tasking currently isn't easy to do in ODK. It's sort of related to these features below, but it isn't exactly the same.

You could add code to Collect where if the CSV changes, it re-generates the SQLite database (the file with .db). Or you could add the data directly to the database. Either way, it'd be pretty fragile...

If this is a feature you really want, describe the underlying problem in greater detail at https://forum.getodk.org/c/features and we can gather feedback from the broader community.

Thanks @yanokwa for your response!
This will be much helpful to us.