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) »
  • A way to import "is_primary" and "is_billing"?
Pages: [1]

Author Topic: A way to import "is_primary" and "is_billing"?  (Read 1376 times)

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
A way to import "is_primary" and "is_billing"?
July 15, 2009, 03:02:34 pm
There doesn't appear to be a way to CSV import an Organization address through the CiviCRM Import feature and make the imported address "is_primary" or "is_billing"....please correct me am I wrong?

I wish to import a few hundred Orgizations, and about 20% of them have a separate address for Billing.

I'm thinking that I will import, then run some MySQL queries on the back end so that the primary addresses are "is_primary" and the billing addresses are "is_billing".

Is this manual MySQL option my only choice or am I missing something?  Just wanted to check before I start to do this the manual way.  Thanks!
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: A way to import "is_primary" and "is_billing"?
July 29, 2009, 05:37:48 am
Yes currently is it is not possible to mark address as is_primary or is_billing. You will have to manually fire SQL commands.

Kurund
Found this reply helpful? Support CiviCRM

rasantiago

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
    • raSANTIAGO + Associates LLC
Re: A way to import "is_primary" and "is_billing"?
July 29, 2009, 08:41:28 am
I think you can handle this in the following manner:

I assume you have a unique ID on each of the contact you are importing.  If not create one. 
Create a batch ID which is the same for all contacts you will import
During the first round of import bring in the contacts and the primary address.
Put the unique ID in the "External ID" field within Civi
Put the batch ID within the "Source" field in Civi
Go through MySQL and get all the contacts with the batch ID, join to the address table and set all addresses to Primary
Then go back and using your unique IDs import the billing addresses
Go through mySQL again and get all contacts with the batch ID, join to the addresses table and mark all addresses as Billing that are not already marked as Primary

Hope that helps...

Roberto




Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • A way to import "is_primary" and "is_billing"?

This forum was archived on 2017-11-26.