I am trying to deploy an XLS form and open it for testing and data collection but I keep getting the error “Unexpected token < in JSON at position 0”. Peculiarly, I deployed this form, without error, then changed a label name and now I only see this error. I have deployed the form many times to no avail and have checked for critical errors and there are none.
I have tried to use the “ODK - XLSForm Online v2.x” to test the form and the only critical error that appears is the use of “begin_kobomatrix” which has always worked in the past for me, regardless of this error, and has supporting documentation for use in XLS forms.
This error seems to go away, after some time, but it does so arbitrarily. I would appreciate any insight into why my form can’t be opened and why it seems to work and not work arbitrarily. Additionally, when I try to open the survey on Safari as opposed to Chrome I get a “String does not match the expected pattern” instead of the aforementioned “Unexpected token” error.
Hi @mar
Welcome to the community forum. Do you experience the same problem when you revert back to the original unedited label name? Can you indicate what label name you had previously and currently?
Hi @stephanealoo ,
Thank you for getting back so quickly!
Yes, I have tried to and it still seems to bring up the error.
I can’t put the exact text but it was something like this:
(1) Text text text
(2) Text text text
(3) Text text text
(4) Text text text
(5) Text text text
Which was changed to:
(1) Text text text
(2) Text text text
(3) Text text text
(4) Text text text (5) Text text text
Because an extra line break was appearing between item 4 and 5.
Well, in this case, please be informed that begin_kobomatrix is a method that only works with KoBoToolbox and should not work with other software that supports xlsform. Hence, for this reason, you are receiving an error message with the online validator.
@Kal_Lam :
Ah okay, that makes sense. Thank you! Additionally, and this is quite strange, but after leaving the survey overnight and trying it this morning, the ‘Unexpected Token’ message does not appear on Kobo anymore and the survey could be opened.
@angelajim, are you still seeing this issue? If yes, would you mind validating your xlsform through this online validator to see if there are any syntax issues?
Hello. Yes, the issue still happend each time I deploy my survey. But when I preview the form twice or three times and I can visualize it.
I tried online validator but apparently everything it’s ok. Anyway, my survey works and I’ve already been working on field. Thank you for your answer.
Desde ayer 3 de agosto a mi me aparece ese mensaje en algunos de los formularios, los implementé satisfactoriamente y los abrí sin ningún problema después en la tarde ya no se podían abrir me mandaba el mensaje Token… así que pensé que algo había hecho mal así que los eliminé y los volví a implementar, y ahora solo puedo abrirlos desde formularios web Enketo en la pc y la app para el teléfono móvil, pero no puedo abrir desde Enketo en los teléfonos móviles ya que me sigue apareciendo el mismo mensaje: Token…