Null integers reported as 0

3636
16
Jump to solution
10-17-2017 03:12 PM
Trippetoe
Occasional Contributor III

Whenever we have a data type of integer that has a null value reported on the survey (for fields that are not required), the actual data value that is stored for the field is 0.  Is there some setting or some such that we need to set so that null values are reported as null instead of 0?

Based on some of our older data, this is a new 'feature'. We have records from older surveys where null integers are indeed reported as null instead of 0.

Thank you.

0 Kudos
16 Replies
Trippetoe
Occasional Contributor III

Hey Brandon.

Thanks for looking into this issue. I really appreciate your help and persistence.

0 Kudos
MartinDe_Las_Heras
New Contributor III

Hello,

Is this still a known bug? I am currently experiencing the same issue, using Survey123 Connect 3.5.166. I'm getting null values when the survey is submitted from the web browser. The field app defaults to 0, but I have a survey that needs to be filled from the web browser. Any help is much appreciated.

0 Kudos
BrandonArmstrong
Esri Regular Contributor

Hi Martin,

The issue(s) mentioned in this thread have been resolved.  Please share your XLSForm if you are encountering inconsistencies in submitted values between the field app and web app.  Also provide us with the version of the field app that you are using when submitting the survey.

Best,

Brandon

0 Kudos
MartinDe_Las_Heras
New Contributor III

Brandon, 

Thanks for the quick reply. I'm using version 3.5.177 of Survey123 on my cell phone. On the XLSForm I have set the default to 0 for these fields, however all these fields/questions are conditional, only appearing on the form when the answer is 'yes' on the previous question. 

The issue caused by these null values is that when any of the 4 calculation fields I have on the XLSForm encounters an empty value, it returns NaN as a result. I must be doing something wrong, I have just recently started using Survey123 Connect instead of the web designer.

Please find form attached.

Thanks,

Martin

0 Kudos
BrandonArmstrong
Esri Regular Contributor

Hi Martin,

The behavior that persists when submitting using the web app is actually the correct behavior.  When a question is is not relevant, even a default value will not and should not be stored in the data.  Only upon becoming relevant should the value be persisted.

We have a defect regarding the behavior that you are encountering with the field app, where default values are being populated even when the question has not yet become relevant. We are hoping to be able to address this with our next release.

The logic of your form may need to be reconsidered so that the expected behavior (default values not being persisted until the question becomes relevant) does not surprise you when it is fixed in Survey123 Connect and the field app.

Best,

Brandon

0 Kudos
MartinDe_Las_Heras
New Contributor III

Hi Brandon,

Thank you for taking a look at my XLSForm and clarifying that! I just wasn't sure which behavior was the correct one. I still need these questions not to be shown unless the user replies 'yes' on the previous question, so I'll adjust my calculation fields so they convert any nulls to zeroes.

Thank you for your help!

Martin

by Anonymous User
Not applicable

Hi Martin,

The issue with default values populating when a question is not relevant has been fixed and you can test it out with latest 3.6 beta builds available on EAC. The latest version to test with is 3.6.100. Please let us know your feedback.

Regards,

Phil.

0 Kudos