A couple users of a survey reported getting the "String or binary data would be truncated" error message when they tried to submit a response, and I realized it was probably because the text question within a repeat was not flagging responses longer than the field length. Is anyone else having this issue with text questions?
I'm using a web form published through Survey123 Connect 3.16 (and see the same bug in the 3.17 preview). The other text questions within the survey that are not in a repeat work fine. The question has a conditional requirement expression, but the issue persists even for a simple text question inside a repeat. I now have a constraint set for that question and added a note providing the count of characters left, but it would be nice if it could work as expected.
Hi @mzhang
Thanks for raising this issue. Would you mind sharing an xlsx with the smallest reproducible issue and we can confirm if this is a BUG for you.
Thanks
Hi @mzhang ,
The following bug was created for this issue:
There is a support article as well that provides a couple of workarounds:
Thank you for the update @AlisonOBrien.
If anyone else comes across this before the bug is fixed, my workaround (publishing in Survey123 Connect 3.16) was to try and recreate the normal behavior of questions with character limits, so the issue would be flagged before the user clicks Submit and a live character count would be provided. It's a more complicated, but makes it more clear to users what the issue is:
Hey mzhang,
I managed to implement the constraint from your first step, and it ended up working great!
That said, I'm struggling to implement the character count you outlined in steps 2 & 3. If you have time, could you elaborate a bit more on how you managed to create that hidden note variable from step 2? I'm looking for a column that can hold a hidden note, but I'm not sure that I see one.
Thanks for your time!
Hi @Marc_Patti, I put type = note, appearance = hidden, and calculation = 256-(string-length(${locationComment}))
I hope that helps!
Awesome, that totally fills in the gap for me. Thanks for your help!