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) »
  • Connecting Indivs and Households on import plus donation info
Pages: [1]

Author Topic: Connecting Indivs and Households on import plus donation info  (Read 1488 times)

chp

  • I’m new here
  • *
  • Posts: 20
  • Karma: 0
  • CiviCRM version: 4.1
  • CMS version: Drupal
  • MySQL version: unk
  • PHP version: unk
Connecting Indivs and Households on import plus donation info
December 12, 2012, 11:38:27 am
OK, first, while this seems like a simple question, I've read through a LOT of documentation and searched the forum with little success so far, so I apologize if this has been answered before.

I have a flat file of students and their parents that I need to import to a fresh installation.  Each record contains student and parent name fields, contact info, etc., so students are in the same record as their parents (different name fields for each).  I'd like to create one household for each family (some families have more than one record b/c they have more than one student).  I'd also like to create individual records for each student and perhaps the parents as well. along with relevant relationships. 

Parents will eventually be solicited for support separately from the students, but could perhaps just be part of the household(?).  Finally, there's a history of donations and other related info that will need to be imported, but the unique ID will be a concatenation of name and address (or email) since the data came from Quickbooks without a unique ID connected to the donor name.

I have a unique ID for each student and one for each household, but haven't separated the parent records out with yet another unique ID...yet.  What is the basic approach for importing the contacts so that: 1) I can generate the proper relationships between indivs and households, and 2) preserve the ability to connect the donation info to the right people?  For the latter, I'm expecting I can create a lookup in a spreadsheet so as to replace the concatenated field with the unique Individual IDs. 

NOTE:  I've already created a separate table for Households (1 record each), and could do the same for the parents and assign a unique ID.

chp

  • I’m new here
  • *
  • Posts: 20
  • Karma: 0
  • CiviCRM version: 4.1
  • CMS version: Drupal
  • MySQL version: unk
  • PHP version: unk
Re: Connecting Indivs and Households on import plus donation info
December 12, 2012, 11:48:01 am
I should clarify that I was planning to import in 2-3 steps, once for HHs, once for students, and once for parents (since all 3 live together in one record).  I've since split out the HH records but it will still mean 3 import passes unless I pull out each contact type as separate rows (I've got contact type field to help generate unique IDs.

But I honestly don't have a good visual for how the import process works, so don't know what makes the most sense.

Thanks again!

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Connecting Indivs and Households on import plus donation info
December 12, 2012, 12:01:56 pm
Hi chp,

I think you've outlined what you need to do fairly clearly.  Since you've already got children/parents in a flat file, I actually wouldn't create separate tables; I would create all your additional fields in that flat file.  So if your relevant columns are: Child Name, Parent1 Name, Parent2 Name*, I would add the following:
Child ID, Parent1 ID, Parent2 ID, Household Name, Household ID.  All the "ID" fields will become "External Identifiers" in CiviCRM.

*Of course you have other fields you're importing, but I expect you know how to handle those.

First, import households.  I imagine households only need a name and external ID, so import the flat file, but only import those two fields.
Second, do an import of the child info.
Third, parent1.  When importing, you can create the relationships by importing the household ID and Child ID columns.  Select "related info", "is in a household", and household ID, and also "related info", "is a parent of", and the Child ID.
Next, do the same with parent2.

Finally, you can do a lookup from your donations records (which SHOULD be in a separate table) to the relevant ID.  You can then import donations by external identifier lookup.

Note that creating relationships slows down an import considerably!
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Connecting Indivs and Households on import plus donation info
December 12, 2012, 12:03:35 pm
To clarify one point - I think it makes a lot of sense to import Parent1 and Parent2 as separate imports.  Otherwise, you need to normalize your data BEFORE importing, which will cause headaches because you need to have the child's ID in the same row as each parent's import record to create the relationship properly.
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

chp

  • I’m new here
  • *
  • Posts: 20
  • Karma: 0
  • CiviCRM version: 4.1
  • CMS version: Drupal
  • MySQL version: unk
  • PHP version: unk
Re: Connecting Indivs and Households on import plus donation info
December 12, 2012, 12:48:04 pm
OK, thanks, JonGold.  I think that makes sense.  I'm working on a test run and will get back if problems. 

On a related note, the test file choked on the field Addressee.  It directs me to look at Admin->Option Lists->Addressee for valid values, but I don't have Option Lists as one of the choices under the Admin menu.  Also, the Addressee field I thought could be one of 3 or so formulas or custom.  If I'm importing text, I'd think that would be valid as custom data.  No?

Thanks again,
Carl

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Connecting Indivs and Households on import plus donation info
December 12, 2012, 01:09:16 pm
Hi Carl,

What version of CiviCRM are you using, and where does the text appear that tells you to check "Admin->Option Lists->Addressee"?  There was a menu reorganization in 4.1, and in some later version of 4.1, I submitted a patch that I thought caught all instances of outdated menu references.

What you're looking for is in: Administer->Communications->Addressee Formats (if I'm understanding what you're looking for correctly).

Custom formatting is stored in a separate field than other addressee formats.  I've never tried importing custom addressee formats, so I don't know how much help I'll be.  However, a good general rule is to do an export of anything you want to import, and look at the formatting on export.
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

chp

  • I’m new here
  • *
  • Posts: 20
  • Karma: 0
  • CiviCRM version: 4.1
  • CMS version: Drupal
  • MySQL version: unk
  • PHP version: unk
Re: Connecting Indivs and Households on import plus donation info
December 13, 2012, 04:27:11 am
How do I find the version?  Someone else installed it and has, I think, recently updated to the latest release.  The note about checking Admin->Options was in the errors file.  So do I import just the text (e.g. Dear John) into the field?  For a household, that might be Dear John and Mary, but that's I think what cholked (there's no names in the household records).

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Connecting Indivs and Households on import plus donation info
December 13, 2012, 07:13:57 pm
Hi Carl,

At the bottom of the page, it should say, "Powered by CiviCRM x.y.z", x.y.z being the version number.

I don't think you can import custom addressee text like you're describing.  Have you tried exporting custom addressee text yet to see the format?

If there's no way to do it through the GUI, there's probably an API method.  However, if it's just a one-off, I would "cheat" and put it in via SQL.
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

chp

  • I’m new here
  • *
  • Posts: 20
  • Karma: 0
  • CiviCRM version: 4.1
  • CMS version: Drupal
  • MySQL version: unk
  • PHP version: unk
Re: Connecting Indivs and Households on import plus donation info
December 13, 2012, 07:48:54 pm
OK thanks, it's 4.2.6.

I was just hopping on to update a little.  My test import worked reasonably well, with records essentially created properly.  But one more question.  Re: households, if I don't import any address info, then no address info gets moved to the HH record (even after members are added), so it would seem to be of little use, particularly for contact purposes.  Might be possible to household donor info, which is, of course, helpful. 

But what about householding for contact purposes (e.g. snail mail?).  If I want to do that do I have to import the address info to the HH record as well?  Isn't there a way that addresses are shared among related records?  I notice when I manually enter data that one address can be shared (though being "owned" by one of the contacts).  I thought that would be how HHs would work when imported, but I don't understand how one of the HH members' addresses gets assigned to the HH itself. 

FInally, re: Addressee field, can I just leave it blank for import and have it assigned automatically by the definition?

Any insights would be helpful.  Thanks!
Carl

chp

  • I’m new here
  • *
  • Posts: 20
  • Karma: 0
  • CiviCRM version: 4.1
  • CMS version: Drupal
  • MySQL version: unk
  • PHP version: unk
Re: Connecting Indivs and Households on import plus donation info
December 13, 2012, 08:20:34 pm
Hmm.  I just did a followup import of the parents of the kids I'd imported earlier.  Thus far, I did an import of the HHs (8 records, 7 unique), then the 8 kids, and now the first parent for each kid.  On this last import of 8 records, CiviCRM says it imported or modified 21 records (there's only 8 records plus a header row in the csv file).   

As it happens, some of the 21 records were "modified" records, and they appear to be the households.  The 7 parent records that were actually added were correct (one record is a dupe b/c there are 2 child records for that household out of the 8 total).  So the only thing that seems odd is that there were 7 records created that were blank during the first parent import.  I had mis-assigned the Parent Of field to a legacy field that wouldn't match anything, so I wonder if that might have been the problem?

OK, I'm getting there.  Tomorrow I hope to do the full import.

Thanks again,
Carl

PS - edited to correct a misunderstanding I had of how the import went.
« Last Edit: December 13, 2012, 08:37:29 pm by chp »

chp

  • I’m new here
  • *
  • Posts: 20
  • Karma: 0
  • CiviCRM version: 4.1
  • CMS version: Drupal
  • MySQL version: unk
  • PHP version: unk
Re: Connecting Indivs and Households on import plus donation info
December 14, 2012, 05:49:01 am
OK, two more questions/issues.  Maybe better as a separate thread, but I don't want to add unnecessary threads...

First, I went in and deleted the 21 records from the first parent import (by searching on the group I'd created for this import).  That included the 7 blank records, the 7 parent records and the 7 updated HHs.  In doing this, I thought I was just deleting the 7 updates to the HH records but in fact I deleted the HHs themselves.  I selected a normal delete so I could recover if needed, but now I can't find how to un-delete the HH records.  Any hints?

Second, when importing I select the checkbox that the first row is a header (i.e. contains field names), and what happens is the field name row appears to be imported as well.  Odd.  Is this what's supposed to happen?

Carl

chp

  • I’m new here
  • *
  • Posts: 20
  • Karma: 0
  • CiviCRM version: 4.1
  • CMS version: Drupal
  • MySQL version: unk
  • PHP version: unk
Re: Connecting Indivs and Households on import plus donation info
December 14, 2012, 06:28:11 am
Sorry for the deluge, but...

While I see the logic of importing HHs first, I see there is an option to assign both the "Master Address belongs to" and "Head of HH is" fields, which would seem to require me to import the head of the household records first.  I assume if I did that I could assign both the head of household AND grab the address fields from the parent.  But I'm assuming the parent record needs to be there in the first place.

Or is it possible to import the field data for the HH and have the link show up after importing the parent/head of HH records?

Carl

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Connecting Indivs and Households on import plus donation info
December 17, 2012, 11:34:53 am
Hi Carl,

I don't know the answers to many of your questions, and you may have discovered answers to others.  I would definitely encourage you to start new threads for the questions you still have unanswered.

Jon
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • Connecting Indivs and Households on import plus donation info

This forum was archived on 2017-11-26.