English

Error: Failed to submit. Operation rolled back. String or binary data would be truncated. The statement has been terminated.

Error Message

In a Survery123 for ArcGIS survey form, inputting a long response in a text field within a repeat section and clicking the Submit button returns the following error:

Error:   
Failed to submit. Operation rolled back. String or binary data would be truncated. The statement has been terminated.
This is the error message.
Note:
In text fields outside a repeat section, inputting a long response returns a character limit warning.

Warning in a singline line text field.

However, in text fields within a repeat section, no warning message is triggered when characters exceed the limit. The character count does not display at the bottom of the answer field. The image below shows a response with 257 characters does not trigger a warning message. The error is returned only when the Submit button is clicked.

No warning message triggered.

Cause

The error is returned when the response exceeds the default character limit of 255.

The default character limit is 255.

Solution or Workaround

As workarounds, increase the character limit of a text field within a repeat section, or create hints as reminders of the character limit.

Increase the character limit of a text field within a repeat section

In the Survey123 Connect for ArcGIS XLSForm, specify the character limit in the bind::esri::fieldLength field. For more information, refer to FAQ: What is the character limit of a text question type field in Survey123 for ArcGIS?

The images below demonstrate how a change in character limit from 255 to 2,000 in the XLSForm bind::esri::fieldLength field is reflected on the Schema Preview tab.

Change the field length.
The character limit is increased to 2000.
Note:
The default character limit for a multiline text field in surveys created using Survey123 for ArcGIS Web Designer is 1,000, as opposed to 255 in surveys created using Survey123 Connect for ArcGIS. In Survey123 for ArcGIS Web Designer, increasing the character limit is accomplished using either one of these methods:
(a) On the Edit tab: Click Edit and check the Set min./max. characters count option under the Validation section. Specify the Max. value and click Save.
(b) On the Modify Schema page: Click Publish > Modify schema. Click the edit (pencil) icon and specify the character limit.

Create a hint for the character limit of a text field within a repeat section

In the Survey123 Connect for ArcGIS XLSForm, specify the hint in the hint field.

The images below demonstrate how a hint on the character limit in the hint field of the XLSForm is reflected on the survey form.

Specify limit in the hint field.
The hint displays on the survey form.

Related Information