Using images with multiple-select from CSV

Hello,

I am trying to integrate the ODK feature of getting multiple-select options from a CSV file into a questionnaire we are designing. We are also thinking about adding images for the choices for this multiple-select. We aren't yet sure how well this will work, but would like to give it a try.

I found documentation for reading CSV choices from a file, which includes a note about adding an "image" column to be read from the csv file. However when using ODK Central, media files can only be uploaded corresponding to things referenced in the uploaded xlsform. Since the image names are stored in the csv file, no entry for these media files shows up there.

I'm wondering if there is a way to upload these image files?

Thanks

I am facing similar issue with dynamic image attachment.
so far could not find any solution.

I found a way around this issue, I added a select_one question with "relevant" set to 0 (so that it doesn't show up in the questionnaire), and for the associated entry in the "choices" sheet, I added an entry for every image which could appear in the CSV file. Then it is possible to upload all of these images. It seems like this might work well enough for us.

3 Likes

@Prashant_K indeed, this does look very similar to your question at Upload media images via odk central that are not part of xlsform choice list/survey directly.

Central does not currently allow for uploading files that are not explicitly listed in the form. What you've come up with @mdg is the best approach I can think of.

@LN @mdg
Thanks you the for the reply.
The same work around I have implemented and it works smooth.
Except one very small issue that one unnecessary column in added to database.

I wanted to revisit this topic to see if it's affecting other people.

My use case:

  • I have large reference CSVs that contain a list of items and some data about them, plus media filenames
  • I want to show these media for reference (via a filtered select and image & big-image and tap to enlarge) or deliver them as dynamic images (ideally also with supressed 'take picture' & 'choose image' buttons) for annotation.

Currently in order to do this, I need to also include an unused choice list that includes all the filenames so that Central will request their upload. This means any changes to the reference file also requires a change to the unused choice list, and a form definition update. I may as well put the reference data as a choice list internally and keep updates to only one location, but this removes the modularity of the form design

Another update to this - beyond having to include a choice list with media filenames to enforce Central attachment upload currently.

If the question is a select_one/multiple_from_file using a CSV that has image and big-image columns in order to show media against the choices (and these have already been included in an internal choice list to force upload so the files are available), these are ignored and the display in Collect will not show the images, I can only make this work with an internal choice list.

For now I have to move questions with images back to internal choice lists, as well as keeping an unused choice list with media filenames when these are used as dynamic default images looked up from a CSV, but would prefer to avoid both these steps as keeping all these data in CSVs allows for a more modular form that's reusable with only updated CSVs.

(related thread on Enketo not handling image/big image and choice filters)