PROBLEM

The configured constraint message is not displayed in ArcGIS Survey123

Last Published: December 27, 2024

Description

In ArcGIS Survey123, constraint messages are not displayed instantly when respondents input responses that do not meet the specified constraints. For text questions with character limit constraints, no messages are displayed when the limit is exceeded; instead, the input is truncated.

Cause

  • By design, ArcGIS Survey123 displays constraint messages only after the survey is submitted, as the constraint validation occurs after submission.
  • By design, the default field length precedes any specified maximum length constraint. The default field length, displayed as the character count below the question text box, truncates the input when the characters exceed the limit instead of returning any message. The question text box below displays the character count of 255.
Character count under the question text box

Solution or Workaround

Use hint

A survey with multiple invalid responses displays the constraint message only for the first non-compliant question, leaving the other invalid responses unflagged. Respondents must resubmit the survey repeatedly to view the constraint message for subsequent questions.

To work around this, configure hints for the question to inform survey respondents on the answer criteria.

  1. In ArcGIS Survey123 Connect, open the survey's XLSForm.
  2. For the question with the constraint, in the hint column, specify the answer criteria.
  3. Press Ctrl + S to save the XLSForm.
Note: 
Optionally, configure a placeholder text to display hints in the question text box. Refer to How To: Add placeholder text for text questions in ArcGIS Survey123 Connect for instructions.

Increase the string value for the text question

In ArcGIS Survey123 Connect, the default character limit for a text question type is 255 characters. Increase the value to allow input exceeding the character limit specified by the constraint. Follow the steps below to display the constraint message when the input exceeds the configured character limit.

  1. In ArcGIS Survey123 Connect, open the survey's XLSForm.
  2. In the Survey worksheet, in the type column, select text from the drop-down menu.
  3. In the name column, specify the question name. In this example, the name is ‘remark’.
  4. In the label column, specify the question label. In this example, the label is ‘Remarks’.
  5. In the constraint column, specify an expression to constrain the number of input characters. In this example, the expression 'string-length(.)>99 and string-length(.)<=500' is specified to constrain the input to a range between 100 and 500 characters.
  6. In the constraint_message column, specify the constraint message. In this example, the message is 'Ensure the remarks are between 100 and 500 characters only!'.
  7. In the bind::esri:fieldLength column, specify a value larger than the maximum character constraint specified in Step 5. In this example, the value is '550'.
  8. Press Ctrl + S to save the XLSForm.
The configuration for a larger maximum character limitation than the default in the XLSForm

Article ID: 000034198

Software:
  • ArcGIS Survey123 Field App iOS
  • ArcGIS Survey123 Field App Android
  • ArcGIS Survey123 Connect

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options