CiviCRM How To: Importing Contacts, Part 1

Do you have a set of contact data that is outside your CiviCRM database, which you need to get into your CiviCRM database?

In this how-to guide, we'll go through the process of importing a set of contacts into CiviCRM. You can use CiviCRM's import functionality to add new contacts to your system, add or update details on contacts that you already have in your CiviCRM database, or do both at the same time! 

Click here for the official CiviCRM documentation on contact imports.

In addition to the contact import, CiviCRM also gives you separate processes for importing contributions, memberships, activities, and event registrations. If you need to add/update contact data and import other kinds of data, you'll want to do an import in two steps. Do the contact import first, to create any new contacts that aren't already in CiviCRM and fill in or update contact info on everyone else. Then you can run another import to add memberships (or contributions or activities or registrations) to your newly-updated CiviCRM contacts. 

Part 1: Start with a Spreadsheet

Whatever format your external data is in, your first step is to turn it into a spreadsheet. If you're starting with data from a separate database or a web application, you can probably download or export it to get a spreadsheet. 

Now you need to prepare your spreadsheet for import. Think about how the data in your spreadsheet will match up to contact fields in CiviCRM. Make sure your spreadsheet has 1 column for each CiviCRM field. You may need to do some work on your data to get it into shape. For example: let's say your spreadsheet has one column for "Name," and each individual's first and last name are both in that one column. We need to split that out! CiviCRM uses a "First Name" field and a separate "Last Name" field, which means your spreadsheet must have one column for everyone's First Names and another column for their Last Names. Tip: your spreadsheet software probably has a "Text to Columns" feature that can split out data into multiple columns like this.

First Name Last Name Email Phone Address 1 Address 2 City State Zip
Chris Smith chris@companyemail.com 123-456-7890 123 Address Street Apt 106 Washington DC 20001
Taylor Green taylor@homeemail.com 555-444-3333 456 Main St   Portland ME 04101
Miles Johnson mjohnson@testemail4.net 999-222-1234 789 First Avenue Unit C Portland OR 97222

Make sure each column has a good, descriptive name at the top of the spreadsheet. You'll use these names later to match up your spreadsheet columns with CiviCRM fields, so this is a good time to give yourself column headings that will be easy to recognize later.

This is also a good time to check your data, especially any values that are going into drop-down fields in CiviCRM. A good example is State/Province. If your spreadsheet has some typos in the State/Province values — or even a non-standard spelling or abbreviation — the importer will not know what to do! A State/Province value of "Calif." is not the same as "CA" or "California." (Both "CA" and "California" are fine, though.) Clean up typos and check your data for standard values now; it'll save time in the long run. 

If you are not sure what type of value to use for a particular field, that's OK! Check out Part 3

If you have a lot of values that need to be changed -- for example, if you're starting with data source that gives you "Calif." for all the Californias, "Ariz." for all the Arizonas, and so on -- see Other Resources at the end of Part 3

Contact types

If your spreadsheet contains more than one Contact Type (individuals, organizations, or households) you will need to split them out into separate spreadsheets and then import them separately. This is because each contact type has a slightly different set of fields: individuals have First Name and Last Name, but organizations have an Organization Name. CiviCRM also has a separate set of duplicate-matching rules for each contact type, and as we'll see soon, that's going to be important. 

For now, just create a fresh spreadsheet for each Contact Type represented in your import. Cut & paste all the organizations or households out of your first spreadsheet and into your new one. Don't forget to copy over your column headers! 

Required Fields

CiviCRM uses a predefined set of required fields to match imported contacts with existing contacts in your database. To import Individual contacts, your spreadsheet must have at least one of the following:

  • CiviCRM Contact ID
  • External ID 
  • Email address
  • First Name and Last Name

For organizations, you'll need Contact ID, External ID, Email, or Organization Name. For households, you'll need — you guessed it — Contact ID, External ID, Email, or Household Name.

Unnecessary Fields or Columns

Your spreadsheet may have some columns that you don't want or need to import right now. That's OK! If you want to delete them from your spreadsheet, you certainly can, but you don't have to. The CiviCRM import process will allow you to flag a column as "Do not import" and skip over it. Especially if you have columns you don't want to import but you do want to keep for future reference, go ahead and leave them where they are.

The Import File

When you have finished organizing and cleaning up your spreadsheet, there's just one more small step before you start importing. Save your spreadsheet as a CSV (comma-separated values) file. Depending on your spreadsheet software, this option might be under "Save As," "Export," "Download," or something else along those lines. 

Once you've done that, you're ready to go! Continue to Part 2.

 

< Previous: Using the CiviCRM Entity Module                    CiviCRM How To: Importing Contacts, Part 2: Next >

Share this post