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 Contact to Multiple Sub Types
Pages: [1]

Author Topic: Import Contact to Multiple Sub Types  (Read 1046 times)

seavers

  • I’m new here
  • *
  • Posts: 1
  • Karma: 0
  • CiviCRM version: CiviCRM 4.1.3
  • CMS version: Joomla! 2.5.6 Stable [ Ember ] 19-June-2012 14:00 GMT
  • MySQL version: 5.0.77
  • PHP version: 5.2.17
Import Contact to Multiple Sub Types
August 08, 2012, 09:28:54 am
I'd like to import contacts, and assign them to multiple contact sub types on import.

For example, I have an Individual, who is both a 'Fundraiser' sub type, and a 'Donator' sub type.

Is it possible to import this contact and have the import process assign him to multiple contact sub types?

The only way I have found at present is to import him once as a Fundraiser, then import him again as a 'Donator', and then manually assign him to both sub types. It's this manual step that I want to avoid.

Any help is greatly appreciated.

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: Import Contact to Multiple Sub Types
August 08, 2012, 12:27:12 pm
I don't think you can do this via the import wizard. one approach might be to make a field to record this info against and then use some sql.
Assuming your import is not actually involving any fields that are specific to any of these sub contact types
If you don't have unique fields for your sub types, you might want to consider just using Tabs to differentiate between them
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

francescbassas

  • I’m new here
  • *
  • Posts: 26
  • Karma: 2
  • CiviCRM version: 4.4.6
  • CMS version: Drupal 7.28
  • MySQL version: 5.3
  • PHP version: 5.1
Re: Import Contact to Multiple Sub Types
November 21, 2014, 09:27:55 am
Something similar is happening to us. We have contacts subtypes that may belong to a contact at once: Child , Adult & Immigrant. A contact can be:
  • Adult
  • Child
  • Adult - Immigrant
  • Child - Immigrant
This allows us to collect the immigrants data only for the profiles who really are. The difficulty lies in
  • when importing data and we are not able to import two subtypes of contact at a time using the wizard.
  • we can not (or do not know) how to update contact subtype value with multiple subtypes to several contacts at once, via batch
Someone else has encountered this problem? How have you solved? Has anyone used a SQL script? Has anyone used the API for that matter? Some code samples?
Any help is welcome ;)

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Import Contact to Multiple Sub Types
November 24, 2014, 12:16:17 am
Hey there,

It might be that https://civicrm.org/extensions/api-csv-import-gui can help you out by providing more flexibility in the handing of contact subtype importing. Not sure how it handles custom data importing though.  Pontentially worth a try.

Otherwise the API is typically the way people go when they have more complex import needs.  I know there are a couple of examples of people that have built helper functions etc. around this. I THINK Jon Goldberg might be able to help. Try a google with his name and import etc. since I THINK he wrote some blog posts on the subject.
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

francescbassas

  • I’m new here
  • *
  • Posts: 26
  • Karma: 2
  • CiviCRM version: 4.4.6
  • CMS version: Drupal 7.28
  • MySQL version: 5.3
  • PHP version: 5.1
Re: Import Contact to Multiple Sub Types
December 08, 2014, 02:50:57 pm
Thanks Michael,

I've been trying the extension you're proposing without success. The extension allows import contact-subtype "field" but not allows multiple contact-subtype values.

I was also looking for some reference Jon Goldberg without success. I look a little more to see if I find any examples that I can use to start.

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: Import Contact to Multiple Sub Types
December 12, 2014, 02:43:22 pm
Jon Goldberg here!

There's a big jump in the learning curve between the GUI import and using some of the API-based techniques I've apparently become known for.  If you had a set of ten different contact subtypes, and needed to assign them based on a set of complicated criteria to thousands of contacts, I'd recommend my approach.

For what's being described here, I can't think of a way to do what's being requested that's simpler than doing two imports.  For speed's sake, my second import would just consist of a contact ID (or external identifier, if contact ID wasn't a field in the CSV being imported).  Nevertheless, it seems the simplest approach.

I'm very hopeful that Jaap Jansma and his friends who are working on CiviRules might be able to provide a solution that's more powerful than GUI import while remaining user-friendly.  I would talk to them, and ask if one of the actions they could write is "add a contact subtype".  Then, you could make a CiviRule that says, "everyone with X tag, add this contact subtype(s)", and import with that tag.  They're sprinting on CiviRules in January and March; the well-timed request might make a big difference!

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

francescbassas

  • I’m new here
  • *
  • Posts: 26
  • Karma: 2
  • CiviCRM version: 4.4.6
  • CMS version: Drupal 7.28
  • MySQL version: 5.3
  • PHP version: 5.1
Re: Import Contact to Multiple Sub Types
December 16, 2014, 12:56:18 am
Hi Jon, thanks for your response,

I finally ended up doing the import manually because the contacts they had two subtypes at a time were few contacts.

But this option about CiviRules sounds perfect for the next time.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • Import Contact to Multiple Sub Types

This forum was archived on 2017-11-26.