An error on previewing/deploying my questionnaire

Dear Kal_Lam,

Thank you for your reply on my post.

I have decided to change the form design itself to avoid the error mentioned in my post, but now I have been struggling with previewing/deploying the updated form. Now the above-mentioned issue (Unexpected token < in JSON at position 0) does not occur but currently my survey form cannot be previewed/deployed in KoBoToolbox.

When I upload the file and go into preview, it continues to load the form for more than 10 minutes and does not show the preview. Deploying the form was also failed.

I checked the form using XLSForm Online v2.0.
It returned that the default value used in geopoint-type questions “-6.175628 106.82699” are not acceptable. I deleted it and the remaining warnings are only “Question has no label”. I suppose it is no problem if I intend to do it. Then the form could be displayed from “open in the browser”.

However, when I upload the file in KoBoToolbox, it won’t work.
I hope if you could find any issues in my form.

WebSurvey_210512.xlsx (238.7 KB)

Please feel free if you need further confirmation on the form.

regards,
Hideo SHIRAISHI

Dear Kal_Lam,

For your information, I am currently checking the questionnaire section by section to identify the exact part which occurs the error.

As far as I found, some questions with the type “select_one desa” seem to occur the error.
When I replace these questions by “note” type, JSON error stopped.

The error message was as below:
JSON.parse: unexpected character at line 1 column 1 of the JSON data

However, when I uploaded the file without changing the question type from select_one to note, sometimes it worked out. I am not sure why.

regards,
Hideo

@hideoshiraishi, have you validated your xlsform through this online validator? It should help you identify the syntax issues present within your xlsform.

Hello,
The problem might be that the desa choice list is very long. You could try it just with few desa items? If yes, that’s the problem - and you may need select from file / pulldata.

2 Likes

Hi @hideoshiraishi
To validate @wroos point, I tested your form by stripping off teh desa and the form loaded quite easily. I would suggest that you use select one from file as recomended by Wroos

Stephane

2 Likes

Thank you for all of your suggestions.
For a quick update, I could do it without any fatal issue.

Here are some updates:

  • I copied the address list (province, kota, kecamatan and desa) to “address.csv” and changed select_one province/ kota/ kecamatan/ desa to select_one_from_file address.csv.

image

  • In “choice” sheet, I deleted the list of address and changed the setting as shown below.

image

I faced the following issue but it resolved after deploying the form.

  • Preview does not accept select_one_from_file showing an error message “invalid data_type: select_one_from_file address.csv”
  • I suppose it will be avoided by deploying it and also understand that this type is available in deployed questionnaire, not Android App according to this post: Error message while previewing a form when using select_one_from_file.
    -My concern was that whether filter function works well or not in an external file. I am using three columns in “choice” sheet relevant to desa (and also province, kota and kecamatan, all are used in conjunction with desa). However it worked properly.

==========
Minor updates:

For the sake of simplicity, I embedded all administration names in different levels (province, kecamatan and desa) in one csv file but I realized that it does not work well as the lower administrative sections appeared in the upper select_one question.
I simply keep major sections (province and kota, which have only a few records) in the main file then exported lists of kecamatan and desa into csv files separately. It worked out perfectly. Thank you.

regards,
Hideo

2 Likes

@hideoshiraishi, you could cascade input from an external file using select_one_from_file as discussed in one of our previous post: