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) »
  • Import error - Req'd Fields not found but ARE in records
Pages: [1]

Author Topic: Import error - Req'd Fields not found but ARE in records  (Read 3311 times)

zoeyo

  • Guest
Import error - Req'd Fields not found but ARE in records
November 11, 2009, 08:42:50 pm
I am trying to import data, and I am getting an error on every record telling me "Missing required fields: First Name and Last Name OR Email Address" -- My understanding (based on reading previous threads in this forum) is that I only need an email field OR the first/last name. Well, I'm ONLY importing email addresses, so I definitely have an email address for every record -- it's the ONLY thing in each record.

So, what am I doing wrong? Thanks!

Kiran Jagtap

  • Ask me questions
  • ****
  • Posts: 533
  • Karma: 51
Re: Import error - Req'd Fields not found but ARE in records
November 11, 2009, 09:42:06 pm
Quote
I am trying to import data, and I am getting an error on every record telling me "Missing required fields: First Name and Last Name OR Email Address"

Import functionality should allow you to import Individual record w/ Email Address.

you might want to try on our demo site : http://drupal.demo.civicrm.org/

If you attach sample data file ( .csv ) here, that would be helpful to debug.
( Of course any private / personal info should be disguised.  )

kiran
You Are Designed To Choose... Defined By Choice.

zoeyo

  • Guest
Re: Import error - Req'd Fields not found but ARE in records
November 11, 2009, 09:53:59 pm
Thanks Kirin,

I can't really attach a data file with any of our data in it because it is all personal data -- it is just a list of email addresses in CSV format. That's it. Nothing else. 1890 rows of email addresses put together via Excel and saved as csv.

So, at this point, I have gotten past that error. Originally the file was 3 columns of email addresses, with the 2nd and 3rd column containing secondary email addresses for the person represented by each row. Obviously, not many people had a second email address, and even fewer had a third. I deleted the 2nd and 3rd columns, and it looked like CiviCRM was going to import the file...

HOWEVER, no such luck...

I got as far as the little popup status window that shows the progress of the import. The import goes until the last 10 records, then I get nothing but a white screen.

I'm sure 1890 rows is not too much data (it's wayyyyy under the file size limit), but I'm going to try splitting the file in half and see what happens. I'll post the results here...

If you have any other suggestions, let me know. Maybe you've seen this problem before. I searched and found nothing.

Kiran Jagtap

  • Ask me questions
  • ****
  • Posts: 533
  • Karma: 51
Re: Import error - Req'd Fields not found but ARE in records
November 11, 2009, 10:28:33 pm
It look like bug for me.

can you integrate this patch and let us know.

go to CRM/Import/Parser/Contact.php line around 181
change if condition
Quote
if ( substr( $key, 0, 5 ) == 'email' && substr( $key, 0, 14 ) != 'email_greeting') {
with
Quote
if ( substr( $key, 0, 5 ) == 'email' &&
      substr( $key, 0, 14 ) != 'email_greeting' &&
      $this->_emailIndex == -1 ) {

I think we should consider first email column for required field, so user can import multiple email address at a time.
So for validation purpose we should consider first email column, therefore first email column should has to have email address.

thanks

kiran
You Are Designed To Choose... Defined By Choice.

zoeyo

  • Guest
Re: Import error - Req'd Fields not found but ARE in records
November 11, 2009, 10:32:50 pm
I split the list in half, and it told me that every row had an error and was not imported, and it told me that every row had been imported. But every line did import. Go figure.

I think I can get the rest of my data imported by doing this in small files, but I'll install the patch in the morning anyway to see if it helps. I'll let you know one way or the other.

zoeyo

  • Guest
Re: Import error - Req'd Fields not found but ARE in records
November 12, 2009, 05:17:11 pm
So, I'm importing my next set of data, and I'm not getting any errors, but it's only importing 15 rows.... it's like it's just ignoring all of the other rows of data. I have 145 rows in my CSV file, and each time I try to import, it tells me 15 rows are importing successfully. That's it. No other error.

I've been working all day, and I'm exhausted. Is the patch you posted yesterday relevant to this issue? I was able to get yesterday's batch of data to import before I saw your patch post.... but maybe I still need the patch?

zoeyo

  • Guest
Re: Import error - Req'd Fields not found but ARE in records
November 12, 2009, 05:23:53 pm
I just tried importing my next set of data just to see if maybe, just maybe, it was this set of data -- nope... whatever I try to import, it takes in 15 rows and ignores everything else as if it does not exist.

Kiran Jagtap

  • Ask me questions
  • ****
  • Posts: 533
  • Karma: 51
Re: Import error - Req'd Fields not found but ARE in records
November 12, 2009, 09:18:09 pm
Quote
I've been working all day, and I'm exhausted. Is the patch you posted yesterday relevant to this issue? I was able to get yesterday's batch of data to import before I saw your patch post.... but maybe I still need the patch?
Given patch is for your original ( yesterday's ) issue. So if the patch is work for original data file than there is no need to split and import.

Quote
So, at this point, I have gotten past that error. Originally the file was 3 columns of email addresses,
I hope you tried given patch with your original .csv file which has three email columns.

Quote
I just tried importing my next set of data just to see if maybe, just maybe, it was this set of data -- nope... whatever I try to import, it takes in 15 rows and ignores everything else as if it does not exist.
What error message system is giving for remaining rows ?

Also make sure if you are splitting data file, column count for each row should be equivalent and should be same as first row.
Those row does not have same column count are ignored.

So finally I would like :
1. Clean/delete partially imported data.
2. Integrate given patch.
3. Try to import main (original ) data file.

hope this help

kiran
« Last Edit: November 12, 2009, 09:21:10 pm by kiran »
You Are Designed To Choose... Defined By Choice.

zoeyo

  • Guest
Re: Import error - Req'd Fields not found but ARE in records
November 15, 2009, 09:43:24 am
Problem solved, but in case anyone else has this problem, I wanted to come back and explain how I solved the issues that I was having.

First, I'll answer Kiran's questions. I was not getting any error message. The system was telling me that it was successfully importing 15 rows. It was as if I only had 15 rows of data, and the system was importing all of them just fine. I tried to import about half a dozen files, all split off from the same data set, to no avail -- same problem on each.

I read on this forum that some people had this problem because Excel's encoding is bad. Some people on this forum had been able to get the data imported by re-saving in Open Office, and I thought to myself... any plain text editor will do.  So, I resaved them as .txt in a couple of different plain text editors, but that didn't do any good. On a whim, not thinking it would work (after all, I already resaved as plain text), I downloaded Open Office and tried (as a last resort) saving in that format. Wah-lah, that data downloaded just fine.

So, bottom line, anyone who's having this 15 rows issue -- the Open Office solution really does work. Try it even if you've already saved in the appropriate format via a text editor (even if you save as txt then back to csv again, Open Office is still your solution!).

Regarding the patch... since I have the data in the system, and it is working, I didn't want to delete it and try again. But I am going to have more data to import again soon, so I will definitely be trying out that patch.

Thanks Kiran! :)

Fernandoe

  • Guest
Re: Import error - Req'd Fields not found but ARE in records
December 03, 2009, 09:31:49 am
Just wanted to say thanks for coming back and reporting on your successful solution/workaround. You pretty much saved me a couple *more* hours of troubleshooting.
Cheers!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • Import error - Req'd Fields not found but ARE in records

This forum was archived on 2017-11-26.