Loading errorr: TypeError: Cannot read property 'previousElementSibling' of undefined

Hi there,

I am making updates to a survey using xls forms. When I upload the spreadsheet it gives me the following error message: * TypeError: Cannot read property ‘previousElementSibling’ of undefined

I have put my spreadsheet through ODK - XLSForm Online v2.x (getodk.org) and if I go on Preview, I have no problem viewing it. However this is not the case in Kobo.

We are really desparate as we need to start field data collection in two days. Can you please help?

Best
Nicole

…and just to add that I have also checked other posts with teh same topic but did not find a solution there either.

Welcome back to the community, @Nicole12! Would you mind sharing your xlsform with the community? If you feel it should be treated confidentially, you could share then through a private message.

Hi there,

sure, what is teh best way to send a private message?

Survey_year2_changed.xlsx (37.8 KB)

@Nicole12, have you tried using Collect android app? I don’t see an issue with the Collect android app. The issue is only with Enketo.

I could see this issue with Enketo:

image

When further looking down, I observed this under the Console tab:

Will get back to you when we find more on this. Maybe till then you could use the Collect android app to collect your data.

Hi there,

I am not quite sure what your observations mean - is there an issue with the website?

When I view the data via ODK XLSF and go to “preview in browser” it has no problem showing me the Enteko page.

Best
Nicole

@Nicole12, we will get back to you when we find more on this.

Ok thanks. I have been on this for a while now. One other thing you may find useful to know: if I download a form of a project that has worked before and upload the spreadsheet again to create a duplicate version, I have exactly the same problem. So, in essence, somthing that has worked before is now giving me an errorr message. I hope you can help.

1 Like

HI @Kal_Lam - sorry to chase this up again but have you been able to find out more information? Thank you, Nicole

Hello @Nicole12,
I don’t know if this creates the problem. But your original xlsform had several invalid variable names. See $given_name column. These names have been automatically corrected by KoBoToolbox (see name column). But some references may now be wrong.
Kind regards

Hi @Kal_Lam , unfortunately fixing the $given_name column didn’t work either. Are there any other options we could look into?
Best,
Nicole

Hello @Nicole12,
Would you mind to provide the updated form version here?

A small additional hint: Some of your OTHER specify text variables are not filtered by selection before. (E.g. Part B “Who provided technical assistance to you?”)

You also have several invalid names in the choices, e.g. with blanks, ’ etc.

Survival rate year 2_KOBO test.xlsx (39.6 KB)

Hi @wroos , here it is. It seems to be working in the Android App btw.

Hello,
I tried to drill down your form and could locate a problem. I added some note to follow what is happening at the calculates. Survival Drilled01.xlsx (26.1 KB)

It seems to be caused in the logic. The -1 at the end of the if clause creates a problem for the following calculate (with the choice label): The whole flow gets blocked. You can try by setting it to 1 instead and you will see, that things seem to work well.

The error you get (with -1) with Preview in KoBoToolbox.

@Kal_Lam, the Online Validator has NO finding (except a label warning).

1 Like

Hi
Thanks so much @wroos for that detailed assessment.

@Nicole12 I find it interesting that this form had worked previously

  • When you download a form of a project that has worked before, are you able to show that project is working well even now i.e. without having to download the XLS form?
  • This will help us understand whether it is the downloading of XLS form that is changing the names.

This will help us dig into the root cause of introducing the problems that @wroos had identifed.

Stephane

1 Like

I had similar problem, what am doing saving the survey as draft first for offline collection and open the draft submission when internet is available, so when load the draft I had that problem appear. So what I did I disabled the choice_filter column to solve the problem and able load the draft survey to form and able now to submit.

1 Like

Welcome back to the community @scptablets! Thank you for sharing the solution with the entire community.