Automatic geocoding using Google Scripts

It depends on how you define the logic of an empty row, but basically it should be an if to check that logic and stop the process if the logic is true (the row is indeed empty).

:frowning: Mine doesn’t work

Error An unknown error has occurred, please try again later.

Please use this instead.

Hi ThinhDinh. This code works. But if I want to get 2 locations at the same time. For example, get FROM location and get TO location on the same record.
Please advise or give me script.

Thanks in advance.

This is a very old thread. If you want to geocode an address, I would suggest using Radar’s integration.

I use Radar at this moment. But it can’t translate Thai language. Hence, I need some thing to get geolocation and now I got it.
The problem now is, I have so many taxi driver locations and so many customer locations. How to get to shortest location to match some locations for some drivers.
I don’t want to display all locations to all drivers simultaneously.

What’s your matching flow at the moment? I’m not sure I would build an app that requires live location like that in Glide.

All drivers will have current location by push location to send current latlong to the system.
Any time, new customers are coming and enter geolocation to the system. At this time, I want to calculate shortest distant to display for any drivers. Not all customer location to be displayed.

I would try adding a distance column to calculate the distance from the “current location” of the driver to all other users’ locations/coordinates. Does that work?

Another problem is location getting from Radar geolocation doesn’t display in Google sheet.

Why do you need it in Sheets?

  1. I would like to collect all locations from driver.
  2. When driver delivers customer. They need to push location button to send current location back to the system. The Single Value can’t get location from that row. It works only from the first row (User-specific column). How to use Single Value to get latest location?
1 Like

It doesn’t matter you’re writing to Sheets or Glide Tables, if I understand you well, wouldn’t Glide Tables just work the same way?

Why do you need to use a Single Value column?

1 Like

How to capture current location and calculate it with all customers location?

Would this work the same way for customers?

No. Customer just enter location in word and I use nominatim.geocoding to get lat long already.

Why don’t you use the same location button for customers? Or can they request rides that are not from the same location they are at?

Actually, the current location feature is not correct location. And I allow customer to enter meeting point instead. And nominatim.geocoding works well.