# Extract Country and City

**URL:** <https://community.glideapps.com/t/extract-country-and-city/80456>\
**Category:** Ask for Help\
**Created:** [March 3, 2025, 9:19am UTC](https://community.glideapps.com/t/extract-country-and-city/80456 "2025-03-03T09:19:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![FloMo](https://avatars.discourse-cdn.com/v4/letter/f/f19dbf/32.png) [@FloMo](https://community.glideapps.com/u/FloMo)\
**Post date:** [March 3, 2025, 9:19am UTC](https://community.glideapps.com/t/extract-country-and-city/80456/1 "2025-03-03T09:19:18Z")

</div>

Hello Glide community.

I have a little challenge. I have GPS location as a column in the user table. I used Radar to get addresses from the GPS co-ordinates. The addresses are not in a uniform format. They all have a city and a country. However sometime the city is second, sometimes it’s third. Sometimes there no delineation between the city and the country.

I am finding it very difficult to get a column with the city and a column with a country.

ChatGPT suggests Javascript. But the suggestions don’t return anything.

Any ideas?

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [March 3, 2025, 9:59am UTC](https://community.glideapps.com/t/extract-country-and-city/80456/2 "2025-03-03T09:59:22Z")

</div>

The radar reverse geocoding API returns separate attributes for both city & country. You should be able to extract them directly with a pair of Query JSON columns.

Just looking at the API docs, you should be able to use something like:

```auto
$addresses[0].country
$addresses[0].city

```

If that doesn’t work, can you show me an example of the JSON response you get from Radar?

---

<div class="post-metadata">

**Author:** ![FloMo](https://avatars.discourse-cdn.com/v4/letter/f/f19dbf/32.png) [@FloMo](https://community.glideapps.com/u/FloMo)\
**Post date:** [March 16, 2025, 11:02am UTC](https://community.glideapps.com/t/extract-country-and-city/80456/3 "2025-03-16T11:02:28Z")

</div>

Thank you so much for your input Darren. This was shockingly simple with Glide AI columns (I went through the course 😁) I didn’t even need radar or anything of that sort. I created a text to text AI column with the questions “What is the country” and "what is the city) using the GPS location column. Voila!

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/0/e0b496726de945d93a9f029ab1a8bd73b05d0821.png)

Thanx once again!

---

<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:** [March 18, 2025, 12:07am UTC](https://community.glideapps.com/t/extract-country-and-city/80456/4 "2025-03-18T00:07:51Z")

</div>

Please beware that this uses additional updates on top of what you have from Radar. I would still check if Radar can offer you directly the country and city in their response, and also prevent the possiblity of hallucinating from AI.
