Select to view content in your preferred language

Error: Failed to submit survey

258
4
a month ago
RyanBohan
Regular Contributor

It took a bit to troubleshoot.  It appears if Survey123 tries to populate a field with more than the default characters 255 the survey gives a random error at submission. 

  • If the field is read only or hidden, no warning shows in the survey itself

It would be great if the survey gave a clearer error, to flag that the concatenated text contains more characters than a field allows.

RyanBohan_1-1720565390585.png

Now that I know the error I can either increase the field or use substr(${field},0,255)

The tricky part as this is caused by a combination of fields, shorter fields will combine no problem, and you end up running in circles trying to find what is causing the error.

I have included my Survey123 xlsx to replicate the error

4 Replies
abureaux
MVP Regular Contributor

Have you tried changing the character limit for that field?

abureaux
MVP Regular Contributor

Here it is in Connect:
abureaux_0-1720633469448.png

I am opposed to the web tool and avoid it like the plague. However, I did try looking for this parameter there... didn't find it so gave up. It may not be a web thing. Yet another reason to use Connect.

 

0 Kudos
RyanBohan
Regular Contributor

The survey I noticed the issue on is already live, and changing the schema will republish the survey and purge all previous entries.

I am currently truncating the results with substr(${field},0,255), some data is lost but at least the user can input their survey.

It would be nice if the survey gave an error, such as "entry too large for field type"

0 Kudos
abureaux
MVP Regular Contributor

It gives errors for text fields, but calculates are kind of a problem-child. They allow unlimited characters despite there being a character limit, and then you see issues like this when you try and submit.

I have two suggestions:

Idea 1: Create a new field with increased character limit. All new submissions will work as intended

Idea 2: Forfeit the data in the problem field by going into Portal > open the Feature Layer > delete the old field > add a new field in (use the exact same name, try to keep the label the same but it doesn't really matter, and provide a more appropriate character limit)

Drawbacks:

Idea 1: You will have two fields. Highly dependant on what you are collecting and why, but this may not be an issue and you can delete the old field at a later date.

Idea 2: You will lose all the old data, but only in this one field.

0 Kudos