Error Message
A survey is successfully published from ArcGIS Survey123 Connect to ArcGIS Online. However, when the published survey is opened in a web browser, the form returns the following error:
Error:
Error: Initializing form…
TypeError: o.split is not a function
Cause
The error message is returned when an invalid expression or value is specified in the constraint column. This can occur when:
- A text question type is configured with a numeric value, such as '5', in the constraint column.
- The maximum number of characters allowed for a text response is specified in the constraint column instead of the bind::esri:fieldLength column.
Solution or Workaround
Depending on the cause, the workarounds provided are applicable.
Use a valid constant expression
- In ArcGIS Survey123 Connect, open the survey’s XLSForm.
- In the survey worksheet, locate the row containing the invalid value in the constraint column.
- In the type column, select the appropriate question type from the drop-down list. In this example, integer is selected.
- In the constraint column, specify a valid constraint expression. The constraint must contain an expression that allows Survey123 to evaluate and validate the response. Refer to ArcGIS Survey123: Constraints for more information. In this example, regex(., '^\d{5}$') is used to require the response to contain exactly five digits.
- Save and close the XLSForm.
- In the survey window, click Publish to republish the survey.
Specify the maximum number of characters in the bind::esri:fieldLength column
- In ArcGIS Survey123 Connect, open the survey’s XLSForm.
- In the survey worksheet, locate the row of the text question and remove the numeric value from the constraint column.
- Scroll right to the bind::esri:fieldLength column and specify the preferred maximum number of characters.
- Save and close the XLSForm.
- In the survey window, click Publish to republish the survey.