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) »
  • Still no way to import multiple groups relations?
Pages: [1]

Author Topic: Still no way to import multiple groups relations?  (Read 2721 times)

alfred_nutile

  • Ask me questions
  • ****
  • Posts: 464
  • Karma: 14
    • River Valley Tech Collective
Still no way to import multiple groups relations?
March 24, 2009, 10:23:49 am
Still seems like there is no way to do a large multi group import.
You can do it with custom fields like (cat1 | cat2 | cat3) and the person would be set for all three categories but you can only do groups one at a time?
For example if a client wants to moving into CiviCRM and their old software had 50 groups they would have to do 50 exports and 50 imports to populate each group?
Ideally they could do one export and import the one file as above with one column having the groups seperated by say a | pipe.
If this is not possible in civicrm then maybe some one can verify these steps.
1. add each group to civicrm
2. add a table for now and import the contacts first, last and email and also the groups they belong to.
3. compare this table with civicrm_group and update  civicrm_group_contact with the correct information.

Since this would be a clean install I would not worry about checking if the person is in the group.
And all the people would already be in the database so I would just get their civiid as part of the above query.

Is there another table I should watch out for or would this be enough.
Thanks




Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Still no way to import multiple groups relations?
March 24, 2009, 11:02:54 am

the method below sounds right

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

jimmyjam

  • I post occasionally
  • **
  • Posts: 87
  • Karma: 4
Re: Still no way to import multiple groups relations?
December 23, 2009, 11:12:31 am
Hi,

I need to do exactly what Alfred wants to do, but I'm new to CiviCRM and the procedure Alfred described is a bit too advanced for me.

Lobo or Alfred, would you please take a moment to describe in greater detail how complete this procedure?

Thank you!
jimmyjam

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: Still no way to import multiple groups relations?
February 02, 2010, 03:03:24 pm
Hmmm,

This certainly isn't a noobie approach, but a simple script using the api is probably the way to go when you want to import more complex data into CiviCRM, like group subscriptions etc.

Get your group subscriptions in an array somehow, then

foreach($subscriptions as $row) {
   $params=array('group_id'=>$row['group_id'], 'contact_id'=>$row['contact_id']);
   civicrm_group_contact_add($params);
}

You need some way of translating from your old group and contact ids to the new ones but if you are comfortable writing simple scripts, you might want to try it :)
« Last Edit: February 02, 2010, 03:08:03 pm by michaelmcandrew »
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

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: Still no way to import multiple groups relations?
February 02, 2010, 05:20:43 pm
A non-coding solution (if anyone is interested) would be to make a checksum field equivalent to your groups - import the csv so the checkbox is ticked for the relevant 'item' - then use Adv Search and add each respective set of Results to a new group

ie Apple Orange Mango
Person 1 Apple (yes) Mango (yes)
Person 2 Apple (yes) Orange (yes)

Adv Search find all Apple >> add to new group = apple (not a Smart Group - a standard one)
Repeat
Serve hot with cream.
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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • Still no way to import multiple groups relations?

This forum was archived on 2017-11-26.