# Zip code

**URL:** https://community.glideapps.com/t/zip-code/78154
**Category:** Ask for Help
**Created:** [November 23, 2024, 9:38pm UTC](https://community.glideapps.com/t/zip-code/78154 "2024-11-23T21:38:42Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Jessie](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jessie/32/57740_2.png) [@Jessie](https://community.glideapps.com/u/Jessie)
#### Post date: [November 23, 2024, 9:38pm UTC](https://community.glideapps.com/t/zip-code/78154/1 "2024-11-23T21:38:42Z")

</div>

The post below has the right question, but I’m seeking an updated response for helping me do the same with AI. Has anyone achieved this? If so, how?

Prior Q&A:

Can we use zip codes to identify city/state location?  
I have a list of countries in my app, but cities are too abundant to list. Anyone know if we can use zip code to identify city/state? All US…

> [@Can we use zip codes to identify city/state location?](https://community.glideapps.com/t/can-we-use-zip-codes-to-identify-city-state-location/16165):
>
> I have a list of countries in my app, but cities are too abundant to list. Anyone know if we can use zip code to identify city/state? All US…

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [November 23, 2024, 9:54pm UTC](https://community.glideapps.com/t/zip-code/78154/2 "2024-11-23T21:54:55Z")

</div>

You could probably create a JSON object, or some kind of delimited list of all city/state/zip combinations, pass that as input into a custom component, and have it generate a dropdown.

---

<div class="post-metadata">

### Author: ![Jessie](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jessie/32/57740_2.png) [@Jessie](https://community.glideapps.com/u/Jessie)
#### Post date: [November 24, 2024, 2:10pm UTC](https://community.glideapps.com/t/zip-code/78154/3 "2024-11-24T14:10:47Z")

</div>

Thanks @Jeff_Hager

I’d like the user to put in a zip and it automagically generates/fills in the city and state fields. Do your guidance change at all, knowing this? Or is it the same?

---

<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: [November 24, 2024, 2:58pm UTC](https://community.glideapps.com/t/zip-code/78154/4 "2024-11-24T14:58:26Z")

</div>

What if your ZIP code isn’t unique across countries? Say I search for a random number like 4000, it shows me both Liège, Belgium and Brisbane, Australia.

---

<div class="post-metadata">

### Author: ![Atom](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/atom/32/82126_2.png) [@Atom](https://community.glideapps.com/u/Atom)
#### Post date: [November 24, 2024, 3:00pm UTC](https://community.glideapps.com/t/zip-code/78154/5 "2024-11-24T15:00:12Z")

</div>

Other experts will have more insight, but I believe the best approach for this would be to use an API to retrieve the City State based on the inputted Zip code.

Like ThinhDinh just mentioned, you need to consider localization.

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [November 24, 2024, 8:25pm UTC](https://community.glideapps.com/t/zip-code/78154/6 "2024-11-24T20:25:37Z")

</div>

> [@Jessie](#):
>
> Do your guidance change at all, knowing this?

It doesn’t change my suggestion. The main consideration is the size of the JSON data and keeping it up to date. There are several versions of some premade JSON out there if you do a search, but it may or may not fit into an entire cell. If I recall, a cell is limited to 1 million characters or something like that. Then you have to consider if you are doing it for other countries as well as the others have pointed out.

I think @Atom makes a good point though about using an API though. The results would always be current.

Just bouncing some ideas. This isn’t something i’ve attempted myself.

---

<div class="post-metadata">

### Author: ![Jessie](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jessie/32/57740_2.png) [@Jessie](https://community.glideapps.com/u/Jessie)
#### Post date: [November 24, 2024, 9:19pm UTC](https://community.glideapps.com/t/zip-code/78154/7 "2024-11-24T21:19:19Z")

</div>

Will look into API, thank you.

---

<div class="post-metadata">

### Author: ![Jessie](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jessie/32/57740_2.png) [@Jessie](https://community.glideapps.com/u/Jessie)
#### Post date: [November 24, 2024, 9:19pm UTC](https://community.glideapps.com/t/zip-code/78154/8 "2024-11-24T21:19:25Z")

</div>

Clarification, this would be localized for only 5 U.S. states - so less of a data set.

---

<div class="post-metadata">

### Author: ![Atom](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/atom/32/82126_2.png) [@Atom](https://community.glideapps.com/u/Atom)
#### Post date: [November 24, 2024, 9:32pm UTC](https://community.glideapps.com/t/zip-code/78154/9 "2024-11-24T21:32:45Z")

</div>

Could probably just make a Glide table and manually copy paste the zips.

Bonus points: Add a button on the front end to submit a ZIP code for review, if the ZIP code entered doesn’t match any in the custom table.

---

<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: [November 25, 2024, 12:02am UTC](https://community.glideapps.com/t/zip-code/78154/10 "2024-11-25T00:02:21Z")

</div>

Yeah, if there aren’t too many, I would suggest a table like @Atom said.

| State | City | ZIP Code |
| --- | --- | --- |
| California | Los Angeles | 90001 |
| California | San Francisco | 94102 |
| California | San Diego | 92101 |
| California | Sacramento | 94203 |
| California | Fresno | 93722 |
| Texas | Houston | 77001 |
| Texas | Austin | 73301 |
| Texas | Dallas | 75201 |
| Texas | San Antonio | 78201 |
| Texas | Fort Worth | 76101 |

But for some states, there can be thousands of them. Please explore the JSON method as an alternative.

---

<div class="post-metadata">

### Author: ![Jessie](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jessie/32/57740_2.png) [@Jessie](https://community.glideapps.com/u/Jessie)
#### Post date: [November 26, 2024, 12:08am UTC](https://community.glideapps.com/t/zip-code/78154/11 "2024-11-26T00:08:09Z")

</div>

Thank you, all! Super helpful to have this community.
