function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jeff@TargetX-chgJeff@TargetX-chg 

Zip code lookup for State, City

I was looking for a way to populate a Contact's city and state based on a zip code. Basically, when I enter a zip code and save the record, I would like the state and city fields to be updated with the appropriate information. I am not sure if it would be easiest to use a web service, API, or trigger. I would rather not build this "table" myself since it would be a bear to maintain. I thought there would be some sort of web service that you could use in conjunction with a formula "state" field that would take the zip, look up the state, and populate that state formula field.
Has anyone else done this?
Thanks, Jeff
werewolfwerewolf
I don't know that there are any AppExchange partners for this, but the US Postal Service does expose an Address API that allows you to resolve zip codes to city and state.
clstanton007clstanton007

I realize that this is quite an old post, but I have to do this EXACT thing.  I'm pretty good with Apex, but new to web services.  Can anyone point me to resources (tutorial?) that could help with this?

 

Thanks!!!