# Automatic geocoding using Google Scripts

**URL:** <https://community.glideapps.com/t/automatic-geocoding-using-google-scripts/11760>\
**Category:** Ask for Help\
**Created:** [July 1, 2020, 12:13am UTC](https://community.glideapps.com/t/automatic-geocoding-using-google-scripts/11760 "2020-07-01T00:13:34Z")\
**Posts on this page:** 18\
**Page:** 2

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [January 10, 2022, 12:07am UTC](https://community.glideapps.com/t/automatic-geocoding-using-google-scripts/11760/21 "2022-01-10T00:07:21Z")

</div>

> <https://stackoverflow.com/questions/28950882/get-a-google-sheet-script-to-skip-empty-rows>

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).

---

<div class="post-metadata">

**Author:** ![WangPlanMoney](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/wangplanmoney/32/32625_2.png) [@WangPlanMoney](https://community.glideapps.com/u/WangPlanMoney)\
**Post date:** [April 2, 2022, 6:32pm UTC](https://community.glideapps.com/t/automatic-geocoding-using-google-scripts/11760/22 "2022-04-02T18:32:52Z")

</div>

☹ Mine doesn’t work

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

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [April 2, 2022, 11:56pm UTC](https://community.glideapps.com/t/automatic-geocoding-using-google-scripts/11760/23 "2022-04-02T23:56:32Z")

</div>

> [@Fetch Column](https://community.glideapps.com/t/fetch-column/31731/13):
>
> As promised: [[Glide: Fetch Column] ](https://www.youtube.com/watch?v=oWrs8bRNyS4)

Please use this instead.

---

<div class="post-metadata">

**Author:** ![Plai\_Official](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/plai_official/32/89253_2.png) [@Plai\_Official](https://community.glideapps.com/u/Plai_Official)\
**Post date:** [June 17, 2025, 11:53am UTC](https://community.glideapps.com/t/automatic-geocoding-using-google-scripts/11760/24 "2025-06-17T11:53:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [June 18, 2025, 12:00am UTC](https://community.glideapps.com/t/automatic-geocoding-using-google-scripts/11760/25 "2025-06-18T00:00:49Z")

</div>

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

> **[Radar Integration | Glide](https://www.glideapps.com/integrations/radar)**
>
> Geocoding and address completion

---

<div class="post-metadata">

**Author:** ![Plai\_Official](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/plai_official/32/89253_2.png) [@Plai\_Official](https://community.glideapps.com/u/Plai_Official)\
**Post date:** [June 18, 2025, 1:50pm UTC](https://community.glideapps.com/t/automatic-geocoding-using-google-scripts/11760/26 "2025-06-18T13:50:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [June 18, 2025, 11:19pm UTC](https://community.glideapps.com/t/automatic-geocoding-using-google-scripts/11760/27 "2025-06-18T23:19:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Plai\_Official](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/plai_official/32/89253_2.png) [@Plai\_Official](https://community.glideapps.com/u/Plai_Official)\
**Post date:** [June 19, 2025, 9:17am UTC](https://community.glideapps.com/t/automatic-geocoding-using-google-scripts/11760/28 "2025-06-19T09:17:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [June 19, 2025, 10:55pm UTC](https://community.glideapps.com/t/automatic-geocoding-using-google-scripts/11760/29 "2025-06-19T22:55:09Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Plai\_Official](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/plai_official/32/89253_2.png) [@Plai\_Official](https://community.glideapps.com/u/Plai_Official)\
**Post date:** [June 20, 2025, 1:28pm UTC](https://community.glideapps.com/t/automatic-geocoding-using-google-scripts/11760/30 "2025-06-20T13:28:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [June 20, 2025, 2:01pm UTC](https://community.glideapps.com/t/automatic-geocoding-using-google-scripts/11760/31 "2025-06-20T14:01:13Z")

</div>

Why do you need it in Sheets?

---

<div class="post-metadata">

**Author:** ![Plai\_Official](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/plai_official/32/89253_2.png) [@Plai\_Official](https://community.glideapps.com/u/Plai_Official)\
**Post date:** [June 21, 2025, 10:47am UTC](https://community.glideapps.com/t/automatic-geocoding-using-google-scripts/11760/32 "2025-06-21T10:47:44Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [June 22, 2025, 12:59am UTC](https://community.glideapps.com/t/automatic-geocoding-using-google-scripts/11760/33 "2025-06-22T00:59:50Z")

</div>

> [@Plai\_Official](#):
>
> I would like to collect all locations from driver.

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?

> [@Plai\_Official](#):
>
> 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?

Why do you need to use a Single Value column?

---

<div class="post-metadata">

**Author:** ![Plai\_Official](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/plai_official/32/89253_2.png) [@Plai\_Official](https://community.glideapps.com/u/Plai_Official)\
**Post date:** [June 22, 2025, 10:06am UTC](https://community.glideapps.com/t/automatic-geocoding-using-google-scripts/11760/34 "2025-06-22T10:06:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [June 22, 2025, 11:38am UTC](https://community.glideapps.com/t/automatic-geocoding-using-google-scripts/11760/35 "2025-06-22T11:38:32Z")

</div>

> [@Plai\_Official](#):
>
> They need to push location button to send current location back to the system.

Would this work the same way for customers?

---

<div class="post-metadata">

**Author:** ![Plai\_Official](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/plai_official/32/89253_2.png) [@Plai\_Official](https://community.glideapps.com/u/Plai_Official)\
**Post date:** [June 26, 2025, 10:30am UTC](https://community.glideapps.com/t/automatic-geocoding-using-google-scripts/11760/36 "2025-06-26T10:30:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [June 26, 2025, 2:16pm UTC](https://community.glideapps.com/t/automatic-geocoding-using-google-scripts/11760/37 "2025-06-26T14:16:40Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Plai\_Official](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/plai_official/32/89253_2.png) [@Plai\_Official](https://community.glideapps.com/u/Plai_Official)\
**Post date:** [June 26, 2025, 5:07pm UTC](https://community.glideapps.com/t/automatic-geocoding-using-google-scripts/11760/38 "2025-06-26T17:07:54Z")

</div>

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

[Previous page](https://community.glideapps.com/t/automatic-geocoding-using-google-scripts/11760.md?page=1)
