Send error string or binary data would be truncated

553
3
Jump to solution
12-29-2019 03:48 PM
JamieLambert
Occasional Contributor III

Hi All,

On the 27th of December everything was working fine and today (30th) our field crews are all getting an error - send error string or binary data would be truncated - on submission. There have been no changes to the survey. Obviously the error referrers to a response not fitting a field length. Survey123 version 3.7.57.

Everything seems to look fine, and I am not aware of any Esri changes between the 27th and the 30th. Is there an easy way to identify the issue in the xlsx form? It would be good to be able to submit a record and ignore the error, letting the data truncate, so I could see the output... 

Really just wondering if there have been any changes recently that may cause a form to fail since the 27th, and the easiest way to identify the issue within the form.

___________________________________________

UPDATE:

I found where the form was getting stuck - still have no idea why this calculation was working on the 27th and not working on the 30th... I ended up adding a Note field to every Hidden field to see exactly what was being written out.

I was extracting the Week value from the Date field using this calculation:

format-date(${date},'%W')

I also extract the Month, Quarter, and Year - they are all still working fine. Just Week is no longer working as of today.

We have been using this for ages with no issue. It seems that the 30th and 31st of December just don't work. Brett Stokes can the team have a quick look at this behavior (30th & 31st of Dec)? Also seems to be an issue with the 'week-number' appearance setting. Thanks.

____________________________________________

Thanks,

Jamie.

0 Kudos
1 Solution

Accepted Solutions
BrettStokes
Esri Contributor

Hi Jamie,

Just an update on this after some more investigation. We're actually using the ISO 8601 week number calculation in the 'week-number' appearance (which does allow for Week numbers 1-53) but have identified a bug in the function. The initial fix has worked for Dec 30-31 of 2019 but now it's possible to return Week 0 for some specific dates (see ISO week date - Wikipedia) which is also erroneous. We've identified an alternative week number function and will implement and test this in time for our next release. 

Interestingly, I've also discovered that the '%W' validation issue will only occur if it's used in a calculation based on a date field that also has a calculation - eg now() or today(). An alternative that does validate successfully would be to set the default date to eg now() or today(). Manually selecting a date, ie no default or calculation set on the date field also validates successfully.

Cheers,

Brett

View solution in original post

3 Replies
BrettStokes
Esri Contributor

Hi Jamie,

Thanks for letting us know about this issue. It seems that the ‘%W’ (week number) qualifier is not working in Connect 3.5, 3.6 or 3.7 - it throws an error when converting the XLSForm. What version of Connect would you have created/published this survey with? Can you share the XLSForm (or a simplified version of it)?

I can reproduce the issue you describe for the 30th and 31st of December 2019 when using the ‘week-number’ appearance on a date field. This is occurring because of the way the week of the year is calculated. The week number will advance on the first Monday* after Jan 1st (*depending on the first day of the week for your particular locale). This can lead to a situation where the last few days of December end up in Week 53 which is obviously not allowed for.

Out of interest, how are you extracting the Quarter information from the Date field? The Doc (https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm#ESRI_SECTION1_DB5A29A...) doesn’t list a qualifier for Quarter…

Can you please submit this issue via Esri Support? I will raise the internal issue so they can be linked up and the impact of the issue can be assessed and prioritised accordingly.

Thanks,

Brett

JamieLambert
Occasional Contributor III

Hi Brett,

Thanks for the explanation. I'll submit this then.

I'm using Survey123 Connect v3.7.60 at the moment and have no issues with %W in a calculation, but I started using the week calculation at an earlier version - I can't recall which version (early 2018) - before %W was added to the validator. You would have to substitute it with something like %M to save the spreadsheet, then change the %M to %W in the XML file before publishing! Refer to this response by James Tedrick > https://community.esri.com/thread/208928-storing-week-number-in-survey123.

Attached is a spreadsheet with the week, quarter, etc. calculations. Nothing too fancy with the Quarter - just an if statement based on the month value.

Cheers,

Jamie.

0 Kudos
BrettStokes
Esri Contributor

Hi Jamie,

Just an update on this after some more investigation. We're actually using the ISO 8601 week number calculation in the 'week-number' appearance (which does allow for Week numbers 1-53) but have identified a bug in the function. The initial fix has worked for Dec 30-31 of 2019 but now it's possible to return Week 0 for some specific dates (see ISO week date - Wikipedia) which is also erroneous. We've identified an alternative week number function and will implement and test this in time for our next release. 

Interestingly, I've also discovered that the '%W' validation issue will only occur if it's used in a calculation based on a date field that also has a calculation - eg now() or today(). An alternative that does validate successfully would be to set the default date to eg now() or today(). Manually selecting a date, ie no default or calculation set on the date field also validates successfully.

Cheers,

Brett

View solution in original post