Extract Country and City

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?

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:

$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?

1 Like