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 Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Exporting data issues - relationships
Pages: [1]

Author Topic: Exporting data issues - relationships  (Read 537 times)

jcost

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
  • CiviCRM version: 3.4, 4.x
  • CMS version: Drupal 6.x, 7.x
  • MySQL version: various
  • PHP version: Various
Exporting data issues - relationships
December 11, 2013, 08:17:46 pm
I am trying to export some data and the issue I am having is with relationships.  I can do an advanced search and find all the people with a specific relationship.  When I try to export the data and display the relationship to get the contact name of the second contact, it only pulls up the name of those with active relationships.  That won't work in this case, I need all relationships, especially inactive ones. 

So then I tried to use the relationship report which does give me what I want, but I can't get the internal contacts IDs which I need to match up with the contact info. 

Is there any way to accomplish this though the interface? 


Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Exporting data issues - relationships
December 11, 2013, 11:18:48 pm
Have you tried getting this with the search builder?
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

joanne

  • Administrator
  • Ask me questions
  • *****
  • Posts: 852
  • Karma: 83
  • CiviCRM version: 4.4.16
  • CMS version: Drupal 7
Re: Exporting data issues - relationships
December 11, 2013, 11:40:57 pm
I can't see any reason why the contact Id (contact B) shouldn't be an option - but as it isn't, do the contact Bs have email addresses you could match on?  Alternatively if you have a small database the display name for contact B might be enough to match on.

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: Exporting data issues - relationships
December 12, 2013, 01:35:20 am
<broken record>Views could help</broken record>
this really is meant as a helpful (or last resort) suggestion if the export issue isn't a goer for you - but i would look to doing this in drupal where there should be no issue of
- grabbing Contact B ID
- ensuring only active relationships are included

i posted recently about the new approach to civi relationships in drupal and can point you to that if you need some help - the post was 'blog' in draft so at some point it should get published when i hear back that it is helpful, or at least accurate.

And yes there is a module for adding a CSV button on a View - again I can provide pointers if you need them.

but i presume you really want a civi way of doing this.
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

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: Exporting data issues - relationships
December 12, 2013, 07:32:09 am
Adding contact B's id as an option to the Relationship report should only take 2 minutes if you're comfortable customizing reports - I could submit a patch if requested, but it'd be against 4.4, and might not get to it this week.

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

joanne

  • Administrator
  • Ask me questions
  • *****
  • Posts: 852
  • Karma: 83
  • CiviCRM version: 4.4.16
  • CMS version: Drupal 7
Re: Exporting data issues - relationships
December 12, 2013, 02:25:52 pm
I thought this would be a good first "code" patch for me (a non-techie) so I worked on this after my post yesterday.  Then I discovered there is an extended relationship report that does so much more in the Extended Reports extension  so I abandoned my efforts.

FWIW if you add

'id_b' =>
          array('title' => ts('Contact ID (Contact B)'),
            'name' => 'id',
               ),

around line 103 in  .../civicrm/CRM/Report/Form/Contact/Relationship.php  you will be able to display the contact ID for contact B

[ line 103, in 4.4 anyway, falls within the definition  'civicrm_contact_b' => array(    ]

jcost

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
  • CiviCRM version: 3.4, 4.x
  • CMS version: Drupal 6.x, 7.x
  • MySQL version: various
  • PHP version: Various
Re: Exporting data issues - relationships
December 13, 2013, 09:02:06 am
Thanks everyone!

This is Civi 3.4.5 and a site we are taking over and didn't build.  I am a PM and don't have a regular Civi developer on staff anymore.  And this is mostly to get the data out to put into a new system.

We probably can't match up by email address because most of these records are children without email addresses, but it looks like many of them are there. Although it might match them up with their parents instead.  That might get us enough to go on and then match others by hand (it's thousands of records, so not a small list, but under 10k).

The views idea is a good one as I know Drupal.  I use the Views bonus pack with the csv export all the time.  It might be a little bit of work to do all that since we didn't build it and I'll have to see what modules are installed. 

Peter - if you have a link to your blog post, that would be helpful. 

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: Exporting data issues - relationships
December 13, 2013, 09:31:36 am
Hi jcost,

If this is intended for a migration, it would be MUCH easier to either use the API or straight SQL than to use the built-in reports.  I had assumed that the end product was for end users.

Try going to http://<yoursite>/civicrm/api/explorer.

I just went to mine and got this:
http://<yoursite>/civicrm/ajax/rest?entity=Relationship&action=get&sequential=1&json=1

Which seems like it's exactly what you're looking for.

You can also do API CSV exports either via the command line (using xavier's api batch tools) or via GUI (using the API CSV extension that Eileen wrote).
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 Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Exporting data issues - relationships

This forum was archived on 2017-11-26.