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) »
  • How to populate fields that are visible via export but not import?
Pages: [1]

Author Topic: How to populate fields that are visible via export but not import?  (Read 753 times)

Erich

  • I post occasionally
  • **
  • Posts: 84
  • Karma: 1
How to populate fields that are visible via export but not import?
July 06, 2011, 04:37:36 pm
When exporting contacts, I can select (among other things) to export the street number/street number suffix/street name/street unit fields, group(s), tag(s), geo_code_1, geo_code_2, etc.

When importing contacts (e.g. if I were to want to move contacts exported from one CiviCRM database into a different but similarly-configured database), as near as I can tell it is only possible to import the geo_code fields, but *not* the street number/street number suffix/street name/street unit fields, and not the group(s) and tag(s).

Is there any way to get these additional CiviCRM fields to show up in the list of available selectable fields when importing users?

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: How to populate fields that are visible via export but not import?
July 07, 2011, 02:05:40 am

not without some code changes. The street number suffix etc are probably quite easy (change to xml file most likely). the groups and tags are  a bit more involved

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

Erich

  • I post occasionally
  • **
  • Posts: 84
  • Karma: 1
Re: How to populate fields that are visible via export but not import?
August 27, 2011, 08:57:14 pm
From http://wiki.civicrm.org/confluence/display/CRMDOC40/CiviCRM+data+architecture I know that "Interacting directly with the database is highly discouraged.  You are very likely to corrupt your database if you are not aware of all the foreign key contrstraints etc.  CiviCRM provides a number of other ways to interact with the data, including import screens, the API , and of course the user interface (UI).  You should use these m which should be used instead of directly manipulating the database."

The above includes a link to http://wiki.civicrm.org/confluence/display/CRMDOC40/CiviCRM+Public+APIs (and I was able to find http://svn.civicrm.org/civicrm/trunk/api/v3/examples/GroupContactCreate.php and http://svn.civicrm.org/civicrm/trunk/api/v3/examples/TagCreate.php).  But, not having written to the CiviCRM API before (in fact, I've never even written a PHP script until recently), I am not at all sure what I'm looking at (and am way lost without a more concrete example I can follow). 

I can query the civicrm_group and civicrm_tag tables and get the group/tag ids for specified group/tag names, and I can query the civirm_contact table for a contact's id ... but is there an example somewhere of adding a specified contact to a specified group (kind of like what the import contact screens do when the "join contacts to existing groups" and/or "tag contacts" options are selected)?

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • How to populate fields that are visible via export but not import?

This forum was archived on 2017-11-26.