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) »
  • Only pre-existing contacts will import
Pages: [1]

Author Topic: Only pre-existing contacts will import  (Read 1329 times)

gje21c

  • I’m new here
  • *
  • Posts: 12
  • Karma: 1
  • CiviCRM version: 3.4.1
  • CMS version: Drupal
  • MySQL version: unknown
  • PHP version: unknown
Only pre-existing contacts will import
September 29, 2011, 11:01:16 pm
Hi,

I'm a CiviCRM newbie, hope this question is not too idiotic  :=)

I'm importing contacts from a CSV file. First 2 lines:

First Name,Last Name,Address,Suburb,Phone,email,Issues,Result of email
Lynne,Charlesworth,144 Hereford St,Forest Lodge,9660 0872,l.charlesworth@bigpond.com,Harold Park,

Only about half the contacts (47 out of 72) import and these appear to be already existing ones in the DB. I can recognise them cos I'm adding a unique tag in the import. (I should add some other marker I guess, to check what's really happening, eg. change the street address and confirm it gets Updated, I'll do that).

I've checked the CSV file for all the usual issues - CR/LF endings, weird chars. I've tried all options of Update, Fill, No Duplicate Checking. And some variants of field assignment.

But it's determined to never import any contact which is new, and not already in the DB. I've checked this with other dummy data in same format as above, ie. Johnny,Tester,123 Somewhere St,Anywhere,12345678,xyz@abc.com. These just won't import. No errors reported at any time in all this.

Date Format is not relevant, there are no dates. I'm not importing the first header line. The Total Rows and Valid Rows show as 47 on the 3rd (Preview) screen, it's as though it's just not seeing the other lines, or discarding them silently before the Preview.

Hopefully this is blindingly obvious and I just have missed a key concept. Apolgies if the above is too brief.

All help much appreciated.

Greg E





Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Only pre-existing contacts will import
September 30, 2011, 08:35:09 pm
Nothing jumps out (other than "did you modify the default strict dedupe rule or choose a different rule?"). Otherwise, next step might be to try your CSV with a few rows of dummy data only on the public demo and see if you get different behavior. Also probably worth updating to latest stable (3.4.6) if you haven't already.
Protect your investment in CiviCRM by  becoming a Member!

gje21c

  • I’m new here
  • *
  • Posts: 12
  • Karma: 1
  • CiviCRM version: 3.4.1
  • CMS version: Drupal
  • MySQL version: unknown
  • PHP version: unknown
Re: Only pre-existing contacts will import
October 01, 2011, 10:51:05 pm
Thanks Dave.

After a large amount of experimentation, I have find that the Import function must see exactly the right number of fields in each line of the CSV, otherwise it silently discards the line, whether there are too few or too many fields w.r.t. the defined import mapping. So trailing empty fields must be present as a ,,, sequence.

Am I right here ? Excel doesn't always save CSV's like this, and it's a very tight restriction. The convention I'm used to is that trailing fields don't need the comma sequence. I would say at the very least the Import should report the lines discarded as some type of error or warning, otherwise they look like dupes were discarded, or you don't even notice what happened.

Cheers,
Greg E


Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Only pre-existing contacts will import
October 02, 2011, 06:51:21 pm
Greg - I'm not sure if that's a requirement of the import - but I would agree that there should be an error output for any discarded rows in general. Would be great if you can investigate and submit a patch. Folks on IRC can help you get started.
Protect your investment in CiviCRM by  becoming a Member!

gje21c

  • I’m new here
  • *
  • Posts: 12
  • Karma: 1
  • CiviCRM version: 3.4.1
  • CMS version: Drupal
  • MySQL version: unknown
  • PHP version: unknown
Re: Only pre-existing contacts will import
October 02, 2011, 11:53:53 pm
Ok. Well I can have a go at progressing this. I take it you're not on the current dev team then ? I don't know the faces around here yet. So I need to submit a bug or RFE via some channel ? I'm not a PHP coder at present.

BTW I forgot to say that it happens on our 3.4.1 and the (3.4.6 ?) Demo site you pointed me to.

It's tempting to say "how could that be still there X years down the track" but everyone thinks their "bug" is astonishing and "thousands" musy have already stumbled on it before  :=)

Thanks for the help.
Greg E

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: Only pre-existing contacts will import
October 03, 2011, 02:57:01 am
Weird. I have never hit this and have done hundreds of imports and can't believe there won't have been some instances in those imports where the final col was empty for some records.
So - is this possibly a csv from Excel problem - i know others have reported other issues when importing from xl.
Care to attach the dummy csv that you said was failing on demo?
If that is the problem then, for others benefit, the step around may be to just have a custom field that all rows have data in - and just ditch that field when it has served its purpose
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

gje21c

  • I’m new here
  • *
  • Posts: 12
  • Karma: 1
  • CiviCRM version: 3.4.1
  • CMS version: Drupal
  • MySQL version: unknown
  • PHP version: unknown
Re: Only pre-existing contacts will import
October 03, 2011, 04:45:57 pm
Hi Petednz,

Yes I could have attached the data earlier I guess. Hanging back for confidentiality. Attached is .xls and the .csv it saves to. You can see about 2/3 of the way down the CSV file there are lines without a trailing comma. I guess it's the difference between an explicitly empty/blank field, and no field at all.

I agree with you it should show up much more. And yes putting a dummy column of data on the end would fix it.

BTW, I'm using Office 2004 for Mac, on Mac OS X 10.6.8, so I'm probably in some small minority, it could be the old Mac Office version. Why don't I check this on my Windows 7 with a later Office ??  Stand by ..

Ok, Windows 7 and Office 2007 save all trailing commas as expected, on this data anyway. So problem solved. PEBKAC, PICNIC, whatever you like. Unusual for Mac to be the problem, buuuuut, Microsoft don't put a pile of effort into Mac Office I guess.

Thanks !  Greg E

PS Didn;t attach data in the end, no need.

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: Only pre-existing contacts will import
October 03, 2011, 04:47:54 pm
Glad it helped - we use NeoOffice and OpenOffice and haven't hit that snag - but we get a problem when we reopen a saved csv and to avoid issues have to grab the data and stick it in a new shiny csv pre import.
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) »
  • Only pre-existing contacts will import

This forum was archived on 2017-11-26.