Uploading Lengthy Cascading Sheet in XLS Form

Hello,

I have a properly formatted XLS form with an extensive (> 90k line) cascading sheet in the “choices” tab. I have tested uploading this form with a subset of the records and all works well, yet when I attempt to upload the form with the full cascading sheet I get an endless loading screen.

Is there a limit to how many lines a cascading sheet can have? I know that the “Insert Cascading Sheet” in the form builder can crash when pasting in many lines, but was hoping that uploading within an XLS form would sidestep the issue.

Any help would be greatly apprecaited!

Hi gemswbg,

It sounds like you’ve found some sort of time-out limit in the system Kobo uses to parse XLS forms. With that much data in the ‘choices’ tab, I recommend exploring the option of using an external csv file for your choices.

You can read about it on xlsform.org (direct link to section here). To populate choices for select questions, you’ll need the search() expression in the appearance column.

This also has the benefit of separating the task of coding your form and maintaining your lookup-csv dataset, which might be quite efficient, given the size of the data you’re working with. It’ll also bypass the timeout issue you’ve found :-).

##EDIT:
I’ve just noticed that the guide on xlsform.org only shows the basic use of search(). For doing cascading selects, you can extend the function a bit. search() can take 4 arguments, using this format:

search('filename','matches','column_name',${value_to_match})

To unpack this a bit:

  • filename = the name of your uploaded csv file.
  • matches = the type of search to use (for now, I suggest sticking with match)
  • column_name = the name of the column in your csv file to search for the value
  • ${value_to_match} = the value to search for in your column_name column. (Typically taken from a previous question, thus the ${} syntax).

Probably the easiest way is through an example. I have an old example here on github that demos a cascading select with an external dataset. (The zip file contains the XLS form and the related csv file).
####

Hope this helps!
Cheers,
~ D.

2 Likes