kobotoolbox / kpi

kpi is the (frontend) server for KoboToolbox. It includes an API for users to access data and manage their forms, question library, sharing settings, create reports, and export data.
https://www.kobotoolbox.org
GNU Affero General Public License v3.0
131 stars 176 forks source link

KoBoToolbox server unable to store integer more than 16 digits for an integer question type! #2812

Open Kalyan-Lama opened 3 years ago

Kalyan-Lama commented 3 years ago

Description

KoBoToolbox at the moment is not able to store integer more than 16 digits for an integer question type. When collecting data through Enketo users are able to collect and submit infinite numbers for an integer question type but when looking back to the server for the stored inputs the numbers gets distorted after the 16 digit.

image

E.g. if you look at the image share above (from DATA>Table), you will see that

Data seen in the server Actual entry made through Enketo
12345678901234568 12345678901234567
1234567890123456 1234567890123456
12345678901234568 12345678901234567
12345678901234567000 12345678901234567890
1234567890 1234567890

Steps to Reproduce

  1. Create a survey project with an integer question type.
  2. Deploy the survey project.
  3. Collect data through Enketo.

Expected behavior

KoBoToolbox's server should be able to show the exact integer collected by Enketo or should have some documentation on the maximum integer number it's able to handle.

Additional details

Link to the community forum: https://community.kobotoolbox.org/t/correct-numeric-field-error-in-kobocollect-application/12711

jnm commented 3 years ago

I'm pretty sure that the reasons why text fields instead of numeric fields should be used for phone/identification numbers have been discussed before. Your suggestion on the forum about text fields with regex to allow digits only is a good one that you should describe as the best practice, not a temporary workaround. However, the silent data loss here is concerning. Does this only occur with Enketo? Since we cannot test data collection with Martijn's preferred getodk.com/xlsform, perhaps it's best just to ask him about integer limitations on Flowdock before going through the effort of moving this bug to the Enketo issue tracker.

Are the extra digits there if you export the submissions? If you edit the record (which reopens Enketo)? If you look at the submission XML through the API? (api/v2/assets/[asset uid]/data/[submission _id].xml)

On Wed, Sep 30, 2020, 5:13 AM Kalyan-Lama notifications@github.com wrote:

Description

KoBoToolbox at the moment is not able to store integer more than 16 digits for an integer question type. When collecting data through Enketo users are able to collect and submit infinite numbers for an integer question type but when looking back to the server for the stored inputs the numbers gets distorted after the 16 digit.

[image: image] https://user-images.githubusercontent.com/50188479/94665186-8bde2280-032b-11eb-9a0a-4404fb348273.png

E.g. if you look at the image share above (from DATA>Table), you will see that Data seen in the server Actual entry made through Enketo 12345678901234568 12345678901234567 1234567890123456 1234567890123456 12345678901234568 12345678901234567 12345678901234567000 12345678901234567890 1234567890 1234567890 Steps to Reproduce

  1. Create a survey project with an integer question type.
  2. Deploy the survey project.
  3. Collect data through Enketo.

Expected behavior

KoBoToolbox's server should be able to show the exact integer collected by Enketo or should have some documentation on the maximum integer number it's able to handle. Additional details

Link to the community forum: https://community.kobotoolbox.org/t/correct-numeric-field-error-in-kobocollect-application/12711

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kobotoolbox/kpi/issues/2812, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAP5BFN6K3WOYAYHHDKABALSILZC7ANCNFSM4R62UQUA .