Link answer to geopoint

Challenge accepted! :slight_smile:

Actually, yes you can… :grin: In XForms any instance element binding can contain a calculation, including geopoints, although in the Kobo KPI form builder this ability is not exposed. But you can certainly have a geopoint result with a calculated value in an XML XForm (!), and with a bit of a fudge you can mimic the same in an XLSForm; see

selectgps.xls (19.5 KB)

In this XLSForm the geopoint has a calculation that picks up the gps string from your selected city. In order to prevent this being over-written I’ve had to make the question read_only, effectively disabling the map widget [aside, ideally you’d make this question relevant=false so the map doesn’t even get displayed, but as a side-effect (bug?) of some XForm clients, including Enketo, they dont bother running calculations of controls that are non-relevant. I must remember to talk to @martijnr about this…]. But the net result is you have a geopoint result in your form that is populated with the gps location of your selected city.

BTW, this is a lot cleaner to accomplish in an actual XML form, because there you can just specify the geopoint instance XML element and associated binding with the calculation, but no actual geopoint control. So the desired geopoint is in the final submission result but nothing is actually displayed in the Collect UI.

Again, whether or not your result viewer (eg Kobo map feature) shows the geopoint ${city} label or not on the map is beyond the scope of the XForm definition.

5 Likes