Select to view content in your preferred language

SyntaxError: Expected token ‘;’ in expression

1054
4
Jump to solution
10-30-2024 08:04 AM
mobius_devil
Emerging Contributor

I am new to Survey123 and Esri, and I encountered an issue when creating a survey using Survey123 Connect.

When I submit the survey, I receive a syntax error: “SyntaxError: Expected token ‘;’ in expression.” Despite this error, I can still submit the survey. However, when I try to edit the same survey, the same error appears, preventing me from sending the survey.

I have reviewed all my expressions in the XML file but cannot find where the ‘;’ should be placed. Any assistance would be greatly appreciated.

Thank you!

0 Kudos
1 Solution

Accepted Solutions
mobius_devil
Emerging Contributor

Thank you for all your input. I fixed the error, and it was not related to spacing. While debugging the Survey123 Connect XML to go through the steps of collecting data, the system showed the field name with the syntax error. The error originated from the instance name in the form settings page. I resolved it by removing the instance name.

View solution in original post

4 Replies
jcarlson
MVP Esteemed Contributor

I believe it's the appearance column. If I recall, you can just give multiple appearance options separated by a space. Remove the ";" characters from that column and see what happens.

- Josh Carlson
Kendall County GIS
mobius_devil
Emerging Contributor

The original expression didn’t include a ‘;’. After encountering the syntax error, I added a ‘;’, but it didn’t resolve the issue. The error persists with or without the ‘;’.

0 Kudos
CodyPatterson
MVP Regular Contributor

Hey @mobius_devil 

I was curious if this could be caused to spacing or similar, in your "${incidentnames} != 'Other'" section, there are spaces, but everything else does not. Also geopoint seems to have been spelled hiden-out, I'm not sure if this is intentional, but this may change it. My final attempt may be to remove the spaces between your multiple fields in the appearances column. Not sure if that's a set one but maybe!

Cody

mobius_devil
Emerging Contributor

Thank you for all your input. I fixed the error, and it was not related to spacing. While debugging the Survey123 Connect XML to go through the steps of collecting data, the system showed the field name with the syntax error. The error originated from the instance name in the form settings page. I resolved it by removing the instance name.