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
Probably you need to support my recent feature request I posted here.
[New expression to get address from latlon, or get latlon from address vice versa](https://community.appsheet.com/t/new-expression-to-get-address-from-latlon-or-get-latlon-from-address-vice-versa/20000) Feature Requests
I wish to have simple expression to return latlong from address value, or other way around, to get the address from latlon value. I only could manage this by writing app script, but it is just wasting time. I wish to intuitive expression like getAddress([Latlon]) getLatlon([Address])
Currently it is not possible to convert the address onto latlong with Appsheet expression. Scripting using Google Map API or other API can manage.
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 } } }