How to allow the entry of decimals in a Survey123 decimal field

3966
23
03-28-2018 10:35 AM
MattRapke
New Contributor II

I am trying to publish my first Survey123 survey that contains a decimal type field. I created the survey using Survey123 Connect, and everything worked fine in the form view on Connect. I published the survey and tried to do a test run to make sure that all the fields worked properly. When I copy-pasted a decimal number into the decimal field, the form converted the decimal to a comma. For example, if I copy 3.92 and paste it into the form, it shows up as 3,93. On the back-end the data is entered properly as a decimal, but the survey will be conducted in Canada and the users will be confused by the comma. Furthermore, I am unable to manually type a "." value into the decimal type field instead of a ",". Is there a setting I am missing to prevent this conversion and allow "." decimal entries?

0 Kudos
23 Replies
KevinThompson
New Contributor III

Hey Doug,

The feature service contains all the decimal places so I think it is happening after that point

Thanks though it was good to check ill let you know if it gets solved via my thread here:Survey123 Mobile App Truncating Number Fields? 

0 Kudos
DougBrowning
MVP Esteemed Contributor

I am doing a lat/long pass and I am getting 9 digits.  Just checked it again.  My map is set to 8 but for sure getting 9.  When I calc in ArcMap I also get 9 no matter how big a make the field in the Attribute table.

Prob not any help but just letting you know.

Also I do have Arcade code that does the lat/long dynamically instead of from a field if that would help you.  Kinda nice for when people move a feature.  Only works in new Collector though.  And since we are mostly Android I am using old school static lat/long still.

Do update since I am using it.

thanks

KevinThompson
New Contributor III

Hello Doug,

Thank you for helping me with this issue

I have tried using Arcade to pull the geometry information but am unable to correctly get the coordinates to accurately convert to Decimal Degrees which is needed when passing off to survey123.

X Conversion:

var originShift = 2.0 * PI * 6378137.0 / 2.0;
var lon = (Geometry($feature).x / originShift) * 180.0;
return [lon];

Y Conversion:

var originShift = 2.0 * PI * 6378137.0 / 2.0;
var lat = (Geometry($feature).y / originShift) * 180.0;
lat = 180.0 / PI * (2.0 * Atan( Exp( lat * PI / 180.0)) - PI / 2.0);
return [lat];

In arcmap I can show all 15 decimal places for the coordinates calculated using the field calculator.

This is getting quite complex!

0 Kudos
DougBrowning
MVP Esteemed Contributor
var originShift = 2.0 * PI * 6378137.0 / 2.0;
var lon = (Geometry($feature).x / originShift) * 180.0;
var lat = (Geometry($feature).y / originShift) * 180.0;

lat = 180.0 / PI * (2.0 * Atan( Exp( lat * PI / 180.0)) - PI / 2.0);

return lon + "  " + lat;

I got the same formula.  I am not surprised they are a tad diff - this is just a simple formula not a full conversion is my guess.  At that many digits you are probably way past the accuracy of your GPS device anyway.

0 Kudos