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) »
  • Multiple value/choice field partial import
Pages: [1]

Author Topic: Multiple value/choice field partial import  (Read 1393 times)

jyee

  • I’m new here
  • *
  • Posts: 19
  • Karma: 3
Multiple value/choice field partial import
August 20, 2010, 07:53:41 am
I ran across a problem that took me a while to solve, so i figured i'd share the answer in case someone else has the same problem:

If you're trying to import a multiple value field, but only some of your values are importing, check the database field length (Administer -> Customize -> Custom Data -> View and Edit Custom Fields -> Edit Field).  You *might* think that a multiple value field would use a many to one relationship in the DB so the field length should be long enough to contain any single choice... but you'd be wrong.  CiviCRM stores multiple values as one long concatenated string, so the field length needs to be long enough to hold *all* values.

Example:
You have a multiple value custom field with values: A, B, C, D, E, F, G
You have import data with rows like "A,D,G" and "A,C,D"
Your imports are not reporting errors, but your imported data is only showing "A,D" and "A,C" respectively.

The problem might be that your custom field has a length of 2.
CiviCRM is trying to store your data as "ADG" and "ACD" (length 3), so those values are being truncated and the end result is that you're only getting a partial import... but again, you won't see any errors about the truncation.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • Multiple value/choice field partial import

This forum was archived on 2017-11-26.