Address Sort via LatLong I have an address c...

Address Sort via LatLong

I have an address column that shows accurately on a maps view. I would like to sort the columns in a table view by not the address (sequential) but by the geolocation of address. Using a VC and an AppFormula how would I convert the address into a LatLong? Possibly HERE([Address]) => GeoCode of address

0 8 709
  • UX
8 REPLIES 8

tony1
New Member

@Buglouse Right now thereโ€™s not a way to convert addresses to latlong types. This is on our todo list.

The only workaround is to use a script or sheet formulas. Hereโ€™s an example that I havenโ€™t tried yet: http://willgeary.github.io/data/2016/11/04/Geocoding-with-Google-Sheets.html

Is there an update to this?

Probably you need to support my recent feature request I posted here.

Currently it is not possible to convert the address onto latlong with Appsheet expression. Scripting using Google Map API or other API can manage.

Hello @tony. How about in reverse situation. I want to convert latlong data into an address. Is it possible?

tony1
New Member

@daw7 Not yet possible in AppSheet, but you might be able to work with an external tool to do this.

daw7
New Member

Thank you @tony. I found a solution to my issue. Instead of extracting address value from a latlong data (or vice versa), I made a separate form and let the user input both the latlong and the adddress data. In that way I can now show the address as a text for display purposes and the latlong value as the exact location when viewed in map view.

Otherwise as Tony mentioned, use external service (actually now internal service? as Appsheet is part of Google) like Google App script and generate the custom function which can be used within Google Sheet. To convert Address field value to lat long is not complicated scripting. Here is sample code.

GEOCODE_GOOGLE(address) { if (address.map) { return address.map(GEOCODE_GOOGLE) } else { var r = Maps.newGeocoder().geocode(address) for (var i = 0; i < r.results.length; i++) { var res = r.results[i] return res.geometry.location.lat + ", " + res.geometry.location.lng } } }

Top Labels in this Space