Error occured during the loading of this form

Dear Madam/Sir,

I uploaded my XLS Form (Enketo Express for KoboToolbox) on https://kf.kobotoolbox.org/ I deployed and tested it on ODK - XLSForm Online, and I did not received any mistake message. But when I try to fill the form, I received the message below :

Error occured during the loading of this form. We do not recommend you use this form for data entry until this is resolved.

Please contact support@kobotoolbox.org with the link to this page and the error message below:

TypeError: Cannot read properties of null (reading ‘dataset’)

I don’t know what to do ?

Welcome to the community, @dimitar237! Are you still facing the issue? If yes please share your XLSForm with the community. The community should help you troubleshoot your issue.

@Kal_Lam ,

I see this is the same error that I have: Forum

Hi!

Reporting the same issue here for some projects.

Project: Error present
20250311 CPVF+IAF V13.xlsx (157.3 KB)

This project has been collecting data since 2025-03-11. The error started showing up today.
Creating a new project, different user, didn’t fix it.

What could be it?

Thanks :raising_hands:

After trying to find out why this specific project is showing the error (while the others don’t), I found that it uses a repeat_count attribute that references the value of a previous question for two repeat gropus

After removing the references from the repeat_count column , the form works fine again.

Might this be the case for you @bfabian333 @dimitar237 ?

Hi @sergiousme, thanks for your help!

Yes, I’ve removed it, and now the form loads correctly.

Do you have any suggestions on adjusting the logic so the form works as it did before? Perhaps a Kobotoolbox update could address this issue?

Thanks again!

Thank you for the proposed solution.
But without repeat_count, the form filling may be biased. If we remove the repeat_count, is there another solution to compensate?

Yet two days ago everything worked fine with repeat_count; there must certainly be a bug on the platform.

For a different project, I managed to add a couple of questions to force the enumerator to enter the exact number of nested records specified in repeat_count.

Before the repeat_group

  • First note asks the enumerator to add the exact number of nested records

After the repeat_group

  • First calculation evaluates the number of records added
  • Second calculation compares these two values
  • Second note appears only if they are not the same (it’s important to set the ‘required’ setting as ‘true’)

Not the most elegant solution but at least it gets the job done.

Yet two days ago everything worked fine with repeat_count; there must certainly be a bug on the platform.

I guess so.

Sergio.

I have the same problem - it worked well a few weeks ago and the problem started with no reason. I do think this is a platform problem rather than xls form problem.

I’m looking at your XLSForm form, but getting a error: Error: [row : 210] List name not in choices sheet: username

I dont see a username list_name anywhere in your choices sheet… :confused:

Did you post the right form earlier?

Sorry about that. My mistake. :face_with_diagonal_mouth: I removed the list as it may have contained personal info. I just updated the form in the original post though.

Thanks!

I believe the form startup error you are seeing is because you are using a repeat_count based on a select response, _cant_integrantes, but initially nothing for that question has been selected yet, so the repeat_count = NULL (and Enketo doesnt know what to do with this, because NULL is not, for example, treated like 0 or 1).

Try this:

It changes the repeat_count calculation so that initially - ie before you answer the (required) _cant_integrantes question - it’ll default to 1 by using a coalesce() function. This value should get replaced by whatever you end up selecting for the selected question when you get down to it, but I havent been able to figure out the other logic in your form to get to that point… Please try this and see if it’ll solve your problem.

FWIW I dont know why this apparantly worked before without this, but repeat-counts based off a select response is a bit unusual, so you may be hitting an edge case. So please try this and report back!

1 Like

This is truly helpful!! Thanks a lot.

I used your solution, using the coalesce() function and it worked perfectly.

The reason for using _cant_integrantes (number of household members) as a select_one question here is because that is a number known previously, so it’s used with a choice_filter to allow only the exact number of members for the specified household.

image

Your approach allowed me to review another project where I’m also using a question in a similar way, to limit the number of nested records but in this case I’m using an integer question with a constraint (the number isn’t known beforehand):

image

However, this form doesn’t show any errors when deployed or updated, so I guess Enketo (I haven’t tested this in KoboCollect) seems to have recently changed the way it handles select_one questions with repeat_count.

Thanks @Xiphware :raising_hands::raising_hands:. I hope this also works for @bfabian333 @dimitar237

Glad its working for you!

… but in this case I’m using an integer question with a constraint (the number isn’t known beforehand)

Yes, it is certainly not uncommon to have a repeat_count that’s a direct integer value (or calculation) which doesn’t cause any problems (!). But clearly have select_one to obtain the value is doing something a little different and causing an issue here. FWIW, I also noticed that coalesce’ing to 0 - instead of 1 - doesn’t work either; so, again, something a bit unusual is going on here… I want to investigate more.

Regardless, coalesce() is a useful trick to add to your bag; it’s a little esoteric and doesn’t see a lot of use, but occasionally it can become very useful. :slightly_smiling_face:

1 Like

Thaks @sergiousme and @Xiphware !! It works!