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) »
  • Importing Relationships - how much relationship data can be imported?
Pages: [1]

Author Topic: Importing Relationships - how much relationship data can be imported?  (Read 1756 times)

slaterino

  • Guest
Importing Relationships - how much relationship data can be imported?
July 12, 2009, 03:33:15 pm
Hi,
I've had a search around for this and there is plenty of information on people importing relationships where they are importing Individual data and then the Organisation Name, using the Employer Of option on import. However, Is it possible to import anymore data regarding the relationship. It is useful to be able to import the basic relationship data but to also import Start Date and End Date would be even more useful! I've had a look at the import function, but there are no options in the matching fields drop-down box for additional relationship data, so I'm not hopeful, but wanted to check if anyone had managed to do this. I know with exporting relationships there may be a work-around using Custom Searches, so was hoping there may be a work-around for this too!

Many thanks,
Russ

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: Importing Relationships - how much relationship data can be imported?
July 12, 2009, 07:46:55 pm

unfortunately i dont think there is a workaround or a simple way. You will need to write a custom PHP/MySQL script to do the needful. if you do so, please publish your code so others may benefit

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

slaterino

  • Guest
Re: Importing Relationships - how much relationship data can be imported?
July 13, 2009, 06:27:17 am
You know, I might have to have a go at doing this. The problem is I have no experience of writing using API's, only of PHP and MySQL. So I'm a bit unsure where to start, and the possibilities that CiviCRM already possesses. I've looked at the documentation but feel a bit flummoxed by it all. Where do you think would be a good place to start? Would it be possible to use the current Import function as a starting point and then customise it for importing multiple fields? This to me would make the most sense, as it means I can utilise a lot of the functions that are there, such as Upload, Mapping, recording of Import Activity. It would then be a case of modifying the import function so that instead of Updating or Filling duplicate entries, it simple creates a duplicate, for that same contact. Does this sound reasonable or do I need to think outside of the box a little more? Are there many design issues that could cause a problem to this rationale?

For looking into this issue, is there any documentation on how the functions are built? I have had a search for the Import function but not found much on the site. There is an import folder in the CRM folder and also in the CRM/Activity folder. Is there any documentation on the structure of the process?

Thanks
Russ

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: Importing Relationships - how much relationship data can be imported?
July 13, 2009, 08:57:51 am

for an overview of civicrm coding / architecture, read: http://civicrm.org/architecture/

import is fairly complex code, so i would start off with writing a separate command line script that does what u need to do and keep it as simple as possible. so use import to get most of the data in, and then use your script to add in more details for the relationships created

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

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Importing Relationships - how much relationship data can be imported?
July 16, 2009, 09:33:03 am
I often have to do complex imports.  I avoid PHP completely and run queries directly on the MySQL database after my import if I need additional data imported.  Being more of a database guy than a PHP guy this is way easier for me.  The CiviCRM tables in the db are named intuitively and you can learn a lot just be looking at the structure.  Good luck!
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • Importing Relationships - how much relationship data can be imported?

This forum was archived on 2017-11-26.