Send Error: truncated

249
5
Jump to solution
04-16-2019 02:39 PM
KatherinePadilla
Occasional Contributor

Hello,

I cannot figure out what in my survey is truncating.  I have attached the xls and the logger.  I have gone through the xls twice and cannot find what is going wrong.  I tried to look at the logger but I don't quite understand yet how to read these.  Any help would be great.  Thanks!!

Katie.

Reply
0 Kudos
1 Solution

Accepted Solutions
KatherinePadilla
Occasional Contributor

I finally figured out what was happening.  There are certain instances where I used != in a calculation and the the outcome was different then expected.  I had not noticed it before as they were calculate fields and I did not see the outcome.  When I found the first one I changed them all to note types and sure enough they all had the issue.

Original calculation that produces a long output (see screenshot)

if((selected(${EVENT_TYPE},'R_Sample') or selected(${EVENT_TYPE},'R_Resample')) and (selected(${SD_FLOW_OBSERVED_TYPE},'Flowing') or selected(${SD_FLOW_OBSERVED_TYPE},'Tidal')) and selected(${SD_FIELD_SCREEN_IND},'N'),string('NR'),if((selected(${EVENT_TYPE},'R_Sample') or selected(${EVENT_TYPE},'R_Resample')) and (selected(${SD_FLOW_OBSERVED_TYPE},'Flowing') or selected(${SD_FLOW_OBSERVED_TYPE},'Tidal')) and selected(${SD_FIELD_SCREEN_IND},'Y') and selected(${SD_COLOR_TYPE},'Other'),concat(${SD_COLOR_TYPE},',',${SD_COLOR_OTHER}),if((selected(${EVENT_TYPE},'R_Sample') or selected(${EVENT_TYPE},'R_Resample')) and (selected(${SD_FLOW_OBSERVED_TYPE},'Flowing') or selected(${SD_FLOW_OBSERVED_TYPE},'Tidal')) and selected(${SD_FIELD_SCREEN_IND},'Y') and ${SD_COLOR_TYPE}!=Other,${SD_COLOR_TYPE},string(''))))

Modified calculation that gets the desired outcome.  I tried to shortcut by using the != exclusion but it cannot be combined with other if then statements it seems.

if((selected(${EVENT_TYPE},'R_Sample') or selected(${EVENT_TYPE},'R_Resample')) and (selected(${SD_FLOW_OBSERVED_TYPE},'Flowing') or selected(${SD_FLOW_OBSERVED_TYPE},'Tidal')) and selected(${SD_FIELD_SCREEN_IND},'N'),string('NR'),if((selected(${EVENT_TYPE},'R_Sample') or selected(${EVENT_TYPE},'R_Resample')) and (selected(${SD_FLOW_OBSERVED_TYPE},'Flowing') or selected(${SD_FLOW_OBSERVED_TYPE},'Tidal')) and selected(${SD_FIELD_SCREEN_IND},'Y') and selected(${SD_COLOR_TYPE},'Other'),concat(${SD_COLOR_TYPE},',',${SD_COLOR_OTHER}),if((selected(${EVENT_TYPE},'R_Sample') or selected(${EVENT_TYPE},'R_Resample')) and (selected(${SD_FLOW_OBSERVED_TYPE},'Flowing') or selected(${SD_FLOW_OBSERVED_TYPE},'Tidal')) and selected(${SD_FIELD_SCREEN_IND},'Y') and (selected(${SD_COLOR_TYPE},'None') or selected(${SD_COLOR_TYPE},'Yellow') or selected(${SD_COLOR_TYPE},'Brown') or selected(${SD_COLOR_TYPE},'White') or selected(${SD_COLOR_TYPE},'Gray')),${SD_COLOR_TYPE},string(''))))

View solution in original post

Reply
0 Kudos
5 Replies
Philip-Wilson
Esri Frequent Contributor

Hi Katie,

This error means you are trying to send data in one of the fields which is longer than the field length set on that field. It could be caused by a calculation or pulldata function you are using where you are putting a larger string into a field, but the feature service has had that field set shorter than the length of the string trying to be submitted. You need to shorten the string in that field, or change the field length.

Phil.

Reply
0 Kudos
KatherinePadilla
Occasional Contributor

Does the logger indicate what field or fields were truncated? This would be helpful to help me narrow down the search and save some time in trying to locate the error. I tried to review the logger but I don’t understand it.

Thanks!

Reply
0 Kudos
Philip-Wilson
Esri Frequent Contributor

Hi Katherine,

No unfortunately not.

Phil.

Reply
0 Kudos
KatherinePadilla
Occasional Contributor

I finally figured out what was happening.  There are certain instances where I used != in a calculation and the the outcome was different then expected.  I had not noticed it before as they were calculate fields and I did not see the outcome.  When I found the first one I changed them all to note types and sure enough they all had the issue.

Original calculation that produces a long output (see screenshot)

if((selected(${EVENT_TYPE},'R_Sample') or selected(${EVENT_TYPE},'R_Resample')) and (selected(${SD_FLOW_OBSERVED_TYPE},'Flowing') or selected(${SD_FLOW_OBSERVED_TYPE},'Tidal')) and selected(${SD_FIELD_SCREEN_IND},'N'),string('NR'),if((selected(${EVENT_TYPE},'R_Sample') or selected(${EVENT_TYPE},'R_Resample')) and (selected(${SD_FLOW_OBSERVED_TYPE},'Flowing') or selected(${SD_FLOW_OBSERVED_TYPE},'Tidal')) and selected(${SD_FIELD_SCREEN_IND},'Y') and selected(${SD_COLOR_TYPE},'Other'),concat(${SD_COLOR_TYPE},',',${SD_COLOR_OTHER}),if((selected(${EVENT_TYPE},'R_Sample') or selected(${EVENT_TYPE},'R_Resample')) and (selected(${SD_FLOW_OBSERVED_TYPE},'Flowing') or selected(${SD_FLOW_OBSERVED_TYPE},'Tidal')) and selected(${SD_FIELD_SCREEN_IND},'Y') and ${SD_COLOR_TYPE}!=Other,${SD_COLOR_TYPE},string(''))))

Modified calculation that gets the desired outcome.  I tried to shortcut by using the != exclusion but it cannot be combined with other if then statements it seems.

if((selected(${EVENT_TYPE},'R_Sample') or selected(${EVENT_TYPE},'R_Resample')) and (selected(${SD_FLOW_OBSERVED_TYPE},'Flowing') or selected(${SD_FLOW_OBSERVED_TYPE},'Tidal')) and selected(${SD_FIELD_SCREEN_IND},'N'),string('NR'),if((selected(${EVENT_TYPE},'R_Sample') or selected(${EVENT_TYPE},'R_Resample')) and (selected(${SD_FLOW_OBSERVED_TYPE},'Flowing') or selected(${SD_FLOW_OBSERVED_TYPE},'Tidal')) and selected(${SD_FIELD_SCREEN_IND},'Y') and selected(${SD_COLOR_TYPE},'Other'),concat(${SD_COLOR_TYPE},',',${SD_COLOR_OTHER}),if((selected(${EVENT_TYPE},'R_Sample') or selected(${EVENT_TYPE},'R_Resample')) and (selected(${SD_FLOW_OBSERVED_TYPE},'Flowing') or selected(${SD_FLOW_OBSERVED_TYPE},'Tidal')) and selected(${SD_FIELD_SCREEN_IND},'Y') and (selected(${SD_COLOR_TYPE},'None') or selected(${SD_COLOR_TYPE},'Yellow') or selected(${SD_COLOR_TYPE},'Brown') or selected(${SD_COLOR_TYPE},'White') or selected(${SD_COLOR_TYPE},'Gray')),${SD_COLOR_TYPE},string(''))))

View solution in original post

Reply
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 calculate values or append metadata that I am unaware of?

 

Thanks

 

A

PS: Also posted here

Reply
0 Kudos