Author Topic: What does invalid value for fields: field id mean? (contribution import problem)  (Read 5647 times)

tbruce

  • Guest
Folks:

We are importing contributions, including some custom data.  The imports worked flawlessly before our upgrade to 1.8.  All rows now return the "Invalid values for field: field id"  error.  I am guessing from very little evidence in forums and in the issue tracker that this has something to do with custom data -- there was an earlier error reported as tracked and fixed in 1.8.  I've now marked all custom fields except one as "do not import", and it hasn't helped -- the remaining field is the one needed to associate the contribution with a donor.

Any hints?

Best,
Tb.

Offline Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15907
  • Karma: 469
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x

Can you please reproduce this on demo, and let us know the steps to see what you did. You might want to save the mapping and attach a copy of a sample import file to your reply so we can reproduce

thanx

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

tbruce

  • Guest
I don't mean to seem uncooperative, but the demo is 1.9 and not the version I'm running (1.8), and your data and mappings are not my data and mappings, so I am not sure what we would be proving; I'd just be trying to gin up an imaginary data set that would somehow not only match your stuff but also embed error-provoking custom data that is not in your schema. I don't see how that would bring us any closer to solving the bug.  I guess I'm missing something; are you suggesting that I add my own custom data schema to the demo and go from there?  We'd still be in the wrong version.

What does the error message itself actually mean?  What's the field id, and how can I find out what field it's ID'ing?  I don't mind going through some code looking for a solution, provided I can get an explanation of the diagnostic.


Offline Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15907
  • Karma: 469
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x

1. we support the current version only and all bugs needs to be reproduced on the demo server. This makes our job significantly easier and also avoids any potential system / install issues

2. We dont need all your data and mappings. Just a small subset that enables us to see what is happening and what bug is being triggerred

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

tbruce

  • Guest
I've been stewing for several days over how to respond to this. I am more than willing to make your job easier by finding the bug myself, but trying to do so blindly by firing data at a demo installation without any sort of information about what sort of condition would typically produce this error message seems, um, inefficient.  All I wanted to know is what the error message means, as a way to start the bug hunt.  If it's a generic message that just means, "gee, there's a problem in the data somewhere", that's fine, but if it in any way localizes the problem that would be a big help.

I certainly don't mean to whine here.  Fact is, I can be a lot more helpful with a little useful advice than I will be if I get a rote response that asks me to take a much longer route to a solution.

Offline Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15907
  • Karma: 469
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x

The error message is fairly generic but basically states that the value does not match the type we are expecting. The error is found here: CRM/Contribute/Import/Parser/Contribution.php

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

Offline daybell

  • I’m new here
  • *
  • Posts: 21
  • Karma: 0
    • Vermont Progressive Party
  • CiviCRM version: 4.1.5
  • CMS version: Drupal 6.26
  • MySQL version: 5.5.22
I am testing importing data into 2.0.0 and running into this same problem with contribution imports.  I am importing only four fields: total amount, receive date, contribution type and a custom field identifying contacts to our old system.  The error I get is: "Invalid value for field(s) : field ID; " but it doesn't indicate what field it is.  I have tried reformatting the cells in the csv, and importing both with or without header rows.

Any ideas?

Offline Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5715
  • Karma: 226
    • My CiviCRM Blog
If you're importing Contribution records, you need to include column(s) in your import file which allow CiviCRM to "match" the contribution records to an existing CiviCRM contact record. This is described in more detail in the "Help" on the Import Contributions screen (mouse-over the question mark).

Protect your investment in CiviCRM by  becoming a Member!

Offline daybell

  • I’m new here
  • *
  • Posts: 21
  • Karma: 0
    • Vermont Progressive Party
  • CiviCRM version: 4.1.5
  • CMS version: Drupal 6.26
  • MySQL version: 5.5.22
I don't think that is the issue.  The last column is a unique identifier (which lives in a custom group).  There is a contact imported with that ID, and the donation row contains that same ID.  Is there a problem importing contributions using a custom field as the identifier?  I don't have any issues using that field when checking for dupes for the contact imports.

Offline Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5715
  • Karma: 226
    • My CiviCRM Blog
When mapping that custom field (step 2 of import) - if you see "(match to contact)" next to the field name - I think it should work. Please see if you can replicate the problem on the public demo - and if so, post detailed steps to replicate and the sample import file to our issue tracker.
Protect your investment in CiviCRM by  becoming a Member!

Offline daybell

  • I’m new here
  • *
  • Posts: 21
  • Karma: 0
    • Vermont Progressive Party
  • CiviCRM version: 4.1.5
  • CMS version: Drupal 6.26
  • MySQL version: 5.5.22
I am pretty sure it was identified "match to content."  I'll test it again, and try to put something up on the demo site.

Offline daybell

  • I’m new here
  • *
  • Posts: 21
  • Karma: 0
    • Vermont Progressive Party
  • CiviCRM version: 4.1.5
  • CMS version: Drupal 6.26
  • MySQL version: 5.5.22
I added the custom ID field (integer) I am using to the demo site, added a record (me) with a value there.  I tried then to import the file containing two donations.  At first it did not show my field ("VPP ID") in the drop down menu of step 2 of the import process.  I then went and changed configure>content matching so that only the VPP ID field was used for content matching (as I have on my civi).  When I tried to import, I was allowed to select that field, and it was denoted "(match to contact)".

I then replicated the same error. "Invalid value for field(s) : field ID;" was returned in the import errors file.

One thing I noticed that might be relevant is that when I save (in Excel) as a csv file, the VPP ID fields are in integer format.  When the data is returned in the import_errors file, the format is changed to general.

I will also post this to the issue tracker.

Offline Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5715
  • Karma: 226
    • My CiviCRM Blog
A workaround that might work for you until this is resolved is to use Import contacts in update mode to set the built-in External Identifier field value to your VPP ID value. Then use external identifier as match to contact on contribution imports. You could test this method quickly by manually updating a single contact record (Edit Contact) - and then trying to import a single contribution record.
Protect your investment in CiviCRM by  becoming a Member!

Offline daybell

  • I’m new here
  • *
  • Posts: 21
  • Karma: 0
    • Vermont Progressive Party
  • CiviCRM version: 4.1.5
  • CMS version: Drupal 6.26
  • MySQL version: 5.5.22
Thanks!  That worked.  I wanted to use a custom fields because I will be importing data from three separate databases (our old one, a statewide voter checklist, and Salsa for a separate candidate's campaign), each with their own people and IDs.  There is some overlap of records between the three.  I guess I will keep all three as separate fields, then import files with two values (Custom ID, and External ID), and use that to clear out and repopulate the External ID as needed to get info from elsewhere.

It seems a little cumbersome, but after we are up and running two of the three (old & Salsa) will be going away, and we can use the checklist ID as the external ID, as well as the civi internal ID.