String or binary data would be truncated Error

2029
12
Jump to solution
04-03-2019 02:12 PM
BrandonAdcock
New Contributor III

I have created a form in Survey 123 Connect.  I tested it in Connect, no problems.  I uploaded it to AGOL and tried to submit a response through the desktop app, no good.

When I attempt to submit a completed form though the iPad or desktop Survey123 apps, it returns an error: SEND ERROR - This survey was not able to be sent due to the following error: - string or binary data would be truncated. The statement has been terminated. - Do you want to edit this survey? Yes - No

I have done some research and spent several hours troubleshooting.  I see a few places which talk about this happening when the field length of a calculated field exceeds the length allowed by the feature service.  I do not seem to have that problem (the only calculated field that is relevant in this submission is a field that combines text and I already made the field length for that field and the fields it is combining appropriate).  Also attempted to publish it as a completely new survey and that didn't solve the problem either.

So, what could be causing this and how do I fix it?  I can attach the spreadsheet I'm using to make the form, but I would have to change a few things for confidentiality and am trying to avoid chasing down those bugs too.

Thank you in advance for your help.

1 Solution

Accepted Solutions
Jim-Moore
Esri Regular Contributor

Hi Brandon

Thank you for the XLSForm. I was able to reproduce the Send Error.

It looks like the default text for the CAT_Cont_Comm question is causing the issue. Connect creates string fields in the feature service using a default field length of 255 characters (the structure of the feature service can be inspected on the Schema Preview tab). The text in the default column for this question is 326 characters, which exceeds the field length.

I was able to resolve this issue by either: specifying a greater field length (e.g. 1000) in the bind::esri:fieldLength column; or shortening the default text string to fit within 255 characters.

Hope this helps, please let me know if this works for you.

I've logged an issue in our system for our team to take a look at whether the default should be validated against field length in Connect prior to publishing.


Best regards,
Jim

View solution in original post

12 Replies
Jim-Moore
Esri Regular Contributor

Hi Brandon

This issue has been seen previously with select_one questions that have a set field length that does not accommodate the question's choices. Does your survey contain any select_one questions? After publishing, have you edited a choice list or the field length for any question and then attempted to republish the survey?

If you could provide your XLSForm that would be great, so I can attempt to reproduce the issue; please feel free to send it to me by direct message if you would prefer not to attach it here.

Thanks,

Jim

BrandonAdcock
New Contributor III

Hi, Jim -

Thank you for your response. I do have select_one questions.  I don't think I have changed the options since publishing, but just in case I republished a fresh survey (using the same spreadsheet) and it kicked back the same error. I edited a few items to make it more anonymous, so here's the spreadsheet for the form I'm working with.

Thanks for your help.

Brandon#

0 Kudos
Jim-Moore
Esri Regular Contributor

Hi Brandon

Thank you for the XLSForm. I was able to reproduce the Send Error.

It looks like the default text for the CAT_Cont_Comm question is causing the issue. Connect creates string fields in the feature service using a default field length of 255 characters (the structure of the feature service can be inspected on the Schema Preview tab). The text in the default column for this question is 326 characters, which exceeds the field length.

I was able to resolve this issue by either: specifying a greater field length (e.g. 1000) in the bind::esri:fieldLength column; or shortening the default text string to fit within 255 characters.

Hope this helps, please let me know if this works for you.

I've logged an issue in our system for our team to take a look at whether the default should be validated against field length in Connect prior to publishing.


Best regards,
Jim

View solution in original post

BrandonAdcock
New Contributor III

Thank you so much, Jim! It looks like making that filed length longer has solved the issue.  I really appreciate you taking a look at it.

If testing the form in Survey123 Connect could reveal these issues, that would be great.  It's my understanding that the field length cannot be changed once published, so to change them I have to completely republish the form and then go find the old versions and get rid of them later.  I'm running out of unique names!  🙂

Brandon

0 Kudos
Jim-Moore
Esri Regular Contributor

Hi Brandon

Great to hear it's working now!

Just FYI you should be able to modify defaults and republish the survey without affecting the feature service.

One tip for testing - you can essentially replace an existing survey by changing its form_id on the Settings tab and then publishing again (see more on the form_id setting here). Please note this will completely delete the existing feature service (and all its data!). The form_id setting controls the name of the target layer in the feature service. So you could use dummy form IDs while testing, and then publish your final version with the actual form ID you would like to use.

Best regards,

Jim

0 Kudos
BrandonAdcock
New Contributor III

Hi Jim –

Thanks for the tip. That’s really good to know about how to test. Super helpful.

Brandon Adcock

Senior Environmental Scientist

CDPH-FSS-ERU

0 Kudos
AndrewHargreaves2
Occasional Contributor III

Hello Survey123 for ArcGIS‌ team,

I am facing this same issue with the

string or binary‌ data would be truncated. The statements has been truncated.

Just like Brandon Adcock‌ I've spent several hours triple checking each field length and the possible answers that can go into them, either from a select_one‌ or a calculation in survey 123‌ - they all have plenty of spare space. What my troubleshooting has unearthed is that I CAN successfully submit through survey123 windows 10‌, but can NOT through survey123 android‌ or survey123 ios‌. Therefore can James Tedrick‌ or another member of the Survey123 for ArcGIS‌ team please tell me if there are differences between the way the three versions caluclate values or append metadata that I am unaware of?

Thanks

A

PS: Also posted here

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Andrew,

I haven't seen a case where this error occurs only on mobile operating systems before.  Can you share the survey design?

AndrewHargreaves2
Occasional Contributor III

XLS emailed directly.

Thanks

0 Kudos