Error: "argument of type 'bool' is not iterable"

Hi Users,

The last two projects I’ve uploaded give me the error “argument of type ‘bool’ is not iterable” when I try to preview them. I checked and can’t see what’s wrong.

They deploy normally and look OK but I’m worried there may be some problem with using the forms to collect data.

Any idea what’s going on / whether this is a serious error / how to fix this error?

Thanks!

1 Like

I get that too, when uploading from xls - however the workaround I use is:
After uploading the xls I then go into form builder, hit edit, change one question (e.g. add a space) then save and change the question back to what it was before and save.
After that I can preview the form just fine, even though the form itself (structure and content/labels) is exactly the same as what I had uploaded via xls.

Would love to know what the reason for this preview error is - I’ve seen it when previewing other peoples’ forms as well so I don’t think it’s just me doing something wrong!

1 Like

Interesting! And a relief - I don’t mind not being able to preview as long as there isn’t any problem with the form, so I’ll probably just leave it.

But yes, I would also like to know the reason!

Hi
Send me the form on XLS on the chat so that I look at it when I am next online

Regards
Stephane

Could you post your XLSForm here for us to take a look. This error message may be coming from pyxform as it is trying to parse your form into XML (as opposed to Enketo)

hi, I think I’ve got to the bottom of it. I’ve attached the simplest possible form where I get the bool not iterable error on preview - it’s to do with the “select_one xxx or_other” question.

If I just have “select_one xxx” then I can preview fine. Once I add the “or_other” then I get the error on first preview (but the workaround of going into edit mode then saving even if no changes are made allows me to then preview with no error). The xls download before editing and after editing look the same to me though.

kobotest4.xls (22 KB)

Thanks

natalie

Could you post both the before (ie broken) and after (ie working) versions. I’m very curious to determine the difference…

Hi @xiphware, as I said, there is no difference at all between the before and after versions of the XLS, apart from the version number/string.

  1. XLS I uploaded: kobotest4.xls (22 KB)
  2. Tried to preview, got bool error.
  3. Downloaded an XLS, this is what I got (obvs I have renamed, to keep track): before with BOOL error on preview.xls (5.5 KB)
  4. Went into form builder and clicked on a heading, hit save (even though there was no asterisk, indicating the system thought no change had been made)
  5. Went into preview, no bool error
  6. Downloaded an XLS, this is what I got: after no BOOL error on preview.xls (5.5 KB)

Note that my project has remained in draft the whole time - but I’ve seen the bool error in preview even on deployed projects.

One interesting thing I noticed that may provide a clue, is the XML. I tried downloading the XML before and got a 0 byte file. But once I’d saved my non-change in Form Builder I downloaded the XML again and this time it downloaded properly.

1 Like

@stephanealoo and @Xiphware, hello and Happy New Year!

Any thoughts on why this gremlin is occurring, and whether a user ought to do anything specific to resolve?

Thanks ever so much!