distance function with Google map link

Hello everyone, Is there a way to use the distance function in appsheet to compare distance between one google map link and another google map link directly in appsheet without having to generate the altitude and longitude values manually.

Thanks indeed

DISTANCE() expression needs location with Lat and Long values and calculates the direct distance between these two points.. not via the route. https://support.google.com/appsheet/answer/11587699?hl=en&sjid=17255049249414730061-EU

1 Like

In my case, for an application that needs the route distance between two points, I use this Google Script function that I call through a bot when the origin or destination change (In origin and destination I put the physical address of the points.):

/* *****************************************************************************************************

  • Distancia de ruta entre dos direcciones
  • @PARAM {string} origen - direccion completa de origen de ruta
  • @PARAM {string} destino - direccion completa de destino de ruta
  • @PARAM {string} modo - modo de la ruta
  • driving (automovil por rutas) POR DEFECTO
  • walking (a pie, por sendas y veredas)
  • bicicling (bicicleta, por ciclovias si las hay)
  • / transit (transporte publico) necesita configurar hora salida o llegada.
  • @return {string} KmsDistancia - Distancia en Kms
    */
    function DistanciaKms(origen, destino, modo = “driving”) {
    let directions = Maps.newDirectionFinder()
    .setOrigin(origen)
    .setDestination(destino)
    .setMode(modo)
    .getDirections();
    const { routes: [data] = } = directions;
    KmsDistancia = data.legs[0].distance.value / 1000

console.log(KmsDistancia);
return KmsDistancia;
}
/** Probar la funcion **/
function _distanciaKms() {
DistanciaKms(“Calatayud”, “Ateca”, modo = “driving”)
}

1 Like

Thank you all indeed for your help