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 Import (Moderator: Yashodha Chaku) »
  • Problem importing 2 email fields & missing surnames
Pages: [1]

Author Topic: Problem importing 2 email fields & missing surnames  (Read 962 times)

peverist

  • I’m new here
  • *
  • Posts: 16
  • Karma: 0
    • Be The Change
  • CiviCRM version: 3.4.4
  • CMS version: Drupal 6.2
  • MySQL version: 5.1.49
  • PHP version: 5.3.3-7+squeeze3
Problem importing 2 email fields & missing surnames
August 16, 2011, 05:31:42 am
Hi

How do I import a secondary, non required email field to an 'other' instance of the the main CiviCRM email field without 'match to contact' (the primary email is used for matching)? THe mapping only allows offers 'email (match to contact') highlighted in red for both fields

I am importing records that have 2 email fields ( 1 main field that is always populated and a second email field that is often not populated). When mapping to the CiviCRM database the only option is to map both fields to 'Email (match to existing contact)'

The problem with this is that if I have a record with no surname, with a populated email 1 field and no email 2, the record gets rejected saying Surname or  email must exist  - it's obviously triggering the error based on no surname and the secondary email being blank (because it was mapped to the email field with match to contact) but there doesn't seem to be an alternate mapping option for the secondary email address to email (don't match to contact)

Regards
Phil

bpmccain

  • I post frequently
  • ***
  • Posts: 255
  • Karma: 5
  • CiviCRM version: 4.1
  • CMS version: Drupal 7.12
  • MySQL version: 5.2
  • PHP version: 5.2
Re: Problem importing 2 email fields & missing surnames
August 16, 2011, 07:43:40 am
How many contacts are you importing?

I've started using the API for contact importing instead of the GUI. I find it's a lot more flexible, faster, more reliable. If you're doing a big import / many imports with the same format, it's definitely worth a look.

Check out these resources:
http://civicrm.org/API_version_3
http://wiki.civicrm.org/confluence/display/CRMDOC40/CiviCRM+Public+APIs

You can actually test out the API using the explorer and code generator at
http://Pathto/civicrm/ajax/doc

but it might be best to play around with it on the sandbox site first so that you don't mess up your database (user: demo, password: demo)
http://drupal.demo.civicrm.org/civicrm/ajax/doc

Happy to share some code if you need it.

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Problem importing 2 email fields & missing surnames
August 16, 2011, 12:29:40 pm
would it work to just sort your spreadsheet and grab all the ones with 2 emails and import and then repeat for all the ones with only 1 email?
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • Problem importing 2 email fields & missing surnames

This forum was archived on 2017-11-26.