CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Poluating COUNTY using USPS API
Pages: [1]

Author Topic: Poluating COUNTY using USPS API  (Read 1241 times)

donniemooretn

  • I’m new here
  • *
  • Posts: 29
  • Karma: 0
    • TN Hands & Voices
  • CiviCRM version: 4.4.3
  • CMS version: WordPress 3.8
  • MySQL version: 5.5.27
  • PHP version: 5.4
Poluating COUNTY using USPS API
November 01, 2013, 10:46:43 am
I have successfully setup the USPS API and it is working to provide the correct address if it is enter incorrectly.  I have notified UPSP Web Tool support and was told that my API is setup to capture the COUNTY.

My questions is this... How do I populate the COUNTY information in the "County" field from USPS?  If this is not possible, How can I populate that field?
Thanks!

Donnie Moore

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Poluating COUNTY using USPS API
November 01, 2013, 10:51:43 am
CiviCRM ships with a sql file of US counties. Look in civicrm/sql/counties.US.sql.gz
Try asking your question on the new CiviCRM help site.

donniemooretn

  • I’m new here
  • *
  • Posts: 29
  • Karma: 0
    • TN Hands & Voices
  • CiviCRM version: 4.4.3
  • CMS version: WordPress 3.8
  • MySQL version: 5.5.27
  • PHP version: 5.4
Re: Poluating COUNTY using USPS API
November 01, 2013, 12:29:24 pm
Thank you so much for providing the information.  I did locate the file you mention.  I am not sure where i need to populate this into the database.  Could you please reference me to an instruction to implement the counties?
Thanks!

Donnie Moore

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Poluating COUNTY using USPS API
November 01, 2013, 04:29:55 pm
You'll need to extract the counties.US.sql file from that zip file (generally by just clicking on it in most environments). Then use phpMyAdmin to run that SQL script in your CiviCRM database.

Separately, make sure you have the Counties field enabled for Address Editing in Administer > Localization > Address Settings.
Protect your investment in CiviCRM by  becoming a Member!

donniemooretn

  • I’m new here
  • *
  • Posts: 29
  • Karma: 0
    • TN Hands & Voices
  • CiviCRM version: 4.4.3
  • CMS version: WordPress 3.8
  • MySQL version: 5.5.27
  • PHP version: 5.4
Re: Poluating COUNTY using USPS API
November 22, 2013, 07:13:34 am
Thanks guys.  Sorry this has taken me a bit to reply.  I was able to successfully populate the County in the Database.  I am able now to select the county base on selecting the Country and State.  The county was then listed.  Is there any possible way for the system to automatically select the county when the address is being verify with the USPS database for address corrections?  Currently right now we have to select the County manually.  Any information or insight into this would  be great.  Other wise, we will have to ensure our membership select the county they are in when they complete the membership application online.

Thanks again for your help.
Thanks!

Donnie Moore

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Poluating COUNTY using USPS API
November 22, 2013, 07:52:07 am

i suspect this is a fairly easy fix to: CRM/Utils/Address/USPS.php

would help if you can get your developer / consultant to extend that code and record the county if counties are enabled in civicrm and USPS returns the county

Please do share you changes back when u make them

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Poluating COUNTY using USPS API

This forum was archived on 2017-11-26.