I am getting an error when trying to submit a survey via Survey123. The error reads " String or binary data would be truncated in table." It is a hidden text field in the survey that is populated by a calculation. The field length should be more than adequate so I can't figure out what is causing the error. I have attached a screenshot of the error and the xlsx file. Any assistance would be greatly appreciated!
@PlANNADMIN You need to add some parenthesis to to separate/group your and "and" and "or" statements. Separating them out helps keep track of where you are when you get that complicated of an if statement.
if(((${service_required} = 'Water' and string-length(${service_installation}) > 0) or(${service_required} = 'E and W' and string-length(${service_installation}) > 0 and string-length(${connection_date}) > 0)),'Completed', if(((${service_required} = 'Water' and string-length(${installation_complete}) > 0 and string-length(${service_installation}) = 0) or(${service_required} = 'E and W' and string-length(${installation_complete}) > 0 and string-length(${service_installation}) = 0 and string-length(${job_end}) > 0)),'Completed_TD', if(((${service_required} = 'E and W' and string-length(${scheduled_start}) > 0 and string-length(${installation_complete}) = 0 and string-length(${inspection}) = 0) or (${service_required} = 'E and W' and string-length(${installation_complete}) > 0 and string-length(${inspection}) = 0) or (${service_required} = 'E and W' and string-length(${scheduled_start}) > 0 and string-length(${installation_complete}) = 0 and ${inspection} = 'Failed' and ${estimate_required} = 'No') or (${service_required} = 'E and W' and string-length(${installation_complete}) > 0 and ${inspection} = 'Failed' and ${estimate_required} = 'No') or (${service_required} = 'E and W' and string-length(${service_installation}) > 0 and string-length(${inspection}) = 0) or (${service_required} = 'E and W' and string-length(${service_installation}) > 0 and ${inspection} = 'Failed' and ${estimate_required} = 'No')),'In_Progress', if(((${service_required} = 'E and W' and string-length(${scheduled_start}) > 0 and string-length(${installation_complete}) = 0 and string-length(${inspection}) > 0 and ${estimate_required} = 'Yes' and string-length(${estimate_cs}) = 0) or (${service_required} = 'E and W' and string-length(${installation_complete}) > 0 and string-length(${inspection}) > 0 and ${estimate_required} = 'Yes' and string-length(${estimate_cs}) = 0) or (${service_required} = 'E and W' and string-length(${service_installation}) > 0 and string-length(${inspection}) > 0 and ${estimate_required} = 'Yes' and string-length(${estimate_cs}) = 0)),'In_Progress_Planning', if(((${service_required} = 'E and W' and string-length(${scheduled_start}) > 0 and string-length(${installation_complete}) = 0 and ${estimate_required} = 'Yes' and string-length(${estimate_cs}) > 0 and string-length(${payment_date}) = 0) or (${service_required} = 'E and W' and string-length(${installation_complete}) > 0 and ${estimate_required} = 'Yes' and string-length(${estimate_cs}) > 0 and string-length(${payment_date}) = 0) or (${service_required} = 'E and W' and string-length(${service_installation}) > 0 and ${estimate_required} = 'Yes' and string-length(${estimate_cs}) > 0 and string-length(${payment_date}) = 0)),'In_Progress_CS','In_Progress_TD')))))
Thats a giant calculation! But it appears to have some syntax errors, I threw your xlsx in Connect, unhid all the fields and received this, which looks bigger than your field length:
Thanks a lot for your help @Neal_t_k! The send error is resolved.
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.