I've developed an XLSForm to calculate coordinates for a remote location using the current location, bearing, and distance. Can I use the calculated coordinates for the remote location to create a new geopoint that will display on a map? I've tried calculating the new geopoint using concat(${remote_lat},',',${remote_lon}) but get an error message.
Is what I'm trying to do simply not supported?
Thanks for any help.
Solved! Go to Solution.
Excellent! That simple change did it. Thanks very much.
I have another question related to the same survey. I originally did all the intermediate calculations as "calculate" types, but kept getting errors in calculating the remote longitude - which depends on the remote latitude among other things. (I'm using Haversine's formula.) I set all the calculations as double-length floating point. When I started displaying all the intermediate results, changing the "calculate" types to "decimal" types, things work. I didn't change the field types; they're all still double floating point.
I suspect this has something to do with the default format for calculate versus decimal. Can somebody please explain this to me so I don't have to display a bunch of intermediate results?
BTW, the error in the longitude calculation was that two separate calculations seemed to be directly concatenated, so a longitude (in radians) that I expected to be, e.g., "-1.123....89" would be displayed as "-1.123....891.00234..78".
I have the same issue with calculate field, it believe it has to do with survey123 spitting out the result of the calculate fields as text. Instead of changing the bind::type to double or integer, try using the number() function. So after a calculate field if the next field were to be an actual visible field (geopoint,decimal, whatever), you would use something like number(${calculate_lat}) instead of simply ${calculate_lat} in the calculation column.
That also worked, John, with a little experimentation. Not only did I use 'number()' with calculated expressions to be displayed visibly, I also had to use it in a calculate field on a previously-calculated result that was outside a trig function (e.g. on "a" in "a + sin b"). Previously-calculated results inside trig functions seemed to work okay without modification.
I really appreciate your suggestions. We're a small conservancy trying to use Survey123 for field data collection, so everything we do is a learning experience!
Thank you.
can you share xlsx for testing