Auto-fill states/cities when a zip code is entered

Hi everyone, do you have any ideas on how I could achieve this? I want the state and city to auto-populate based on the entered zip code.

I’m sure you can have a table that would allow that, but keeping it up to date would be a pain. The other factor to consider is that zipcodes are NOT exclusive, sometimes a single zipcode covers more than one city. (I don’t think there’s any that cover more than one state, so you’re safe there)

I’ve had to deal with that many years ago on a completely different system. I lived and worked in a place where the zipcode covered two different counties for the same city. What it came down to is having to add something so that when a zipcode wasn’t exclusive, it would pop up the matches and allow them to select which one.

I know this doesn’t help, I just thought I’d mention the issues I had encountered in the past :slight_smile:

1 Like

I think this was why the ZIP+4 became so important.

The USPS tool can return multiple cities in the event that there are multiple possibilities, but I’m not sure how one would go about choosing. I guess you would need to present your options to the user.

https://tools.usps.com/zip-code-lookup.htm?citybyzipcode

a bit more info here: https://www.usps.com/business/web-tools-apis/address-information-api.htm#_Toc179194918

I recall that there was an education document for advanced Epicor Functions that had an example of accessing the ZIPcodeAPI API. Not sure if that will give you the detail you are looking for, but the website is https://www.zipcodeapi.com/

1 Like

Hi Hally, do you have that document can you share please.

Best I can do is get to you ask your CAM… The embedded education documents were no longer included with the On-Prem installs after 2022.1 and you actually needed the embedded education licence.