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) »
  • [Solved] Importing notes
Pages: [1]

Author Topic: [Solved] Importing notes  (Read 713 times)

PhilippeS

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 5
  • CiviCRM version: 4.6.x
  • CMS version: Drupal 7
  • MySQL version: Last version in Debian Jessie
  • PHP version: Last version in Debian Jessie
[Solved] Importing notes
September 17, 2014, 07:33:33 am
I have a problem for importing multiple notes for contacts.
In a csv file, I have 2 notes column for each contact. If I map the 2 fields for importing. Only the first column is imported. Ok why not.
But if I launch a second batch to import the second note, CiviCRM import the second note 2 times.
In import form, I have tried options : Update or  Fill in the field For Duplicate Contacts. The result is the same. Notes are imported 2 times.

In conclusion, how can I import contacts with 2 notes ?

Thanks,
Philippe
« Last Edit: September 19, 2014, 07:04:05 am by PhilippeS »

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: Importing notes
September 17, 2014, 07:54:20 am
Phillippe,

I think you might have better luck importing the notes separately through the API, perhaps with the API csv Import GUI extension?  https://civicrm.org/extensions/api-csv-import-gui

I'm not saying it's the way it SHOULD be - I think that importing notes should be better supported at a few levels in CiviCRM - but it's better to have an answer than curse the lack of them!
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

PhilippeS

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 5
  • CiviCRM version: 4.6.x
  • CMS version: Drupal 7
  • MySQL version: Last version in Debian Jessie
  • PHP version: Last version in Debian Jessie
Re: Importing notes
September 18, 2014, 07:39:55 am
Thank you.

I have installed this extension. I will test tomorrow.

PhilippeS

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 5
  • CiviCRM version: 4.6.x
  • CMS version: Drupal 7
  • MySQL version: Last version in Debian Jessie
  • PHP version: Last version in Debian Jessie
Re: Importing notes
September 19, 2014, 02:37:31 am
This extension does not work in my case.

I do not have the "Entity ID" value in the dropdown list : Matching CiviCRM Field. And necessarily, the import fails with the error: "Missing required field (s): entity_id"
Also, in my CSV, I don't have the civirm ID of the contact, only an extrenal ID.

PhilippeS

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 5
  • CiviCRM version: 4.6.x
  • CMS version: Drupal 7
  • MySQL version: Last version in Debian Jessie
  • PHP version: Last version in Debian Jessie
Re: [Solved] Importing notes
September 19, 2014, 07:20:18 am
I found a solution. It's base on a reply of aberverley : http://forum.civicrm.org/index.php/topic,21469.msg105353.html#msg105353

I import contacts with the first note. And then I updated records with the second note. So this second note is now 2 times in the database, I deleted the duplicated note with some SQL queries:

Code: [Select]
create table tempnotes (id int);

INSERT INTO tempnotes( id )
SELECT max( id )
FROM `civicrm_note`
WHERE `entity_table` = 'civicrm_contact'
AND entity_id >=21798
GROUP BY entity_id
HAVING count( id ) >1

DELETE FROM civicrm_note WHERE id IN (
  SELECT id FROM tempnotes
)

drop table tempnotes;

This only works for 2 notes, beyond it is impossible to delete notes in doubles with this method.


If someone can explain to me why the notes are imported twice. I'm interested in the technical explanation.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • [Solved] Importing notes

This forum was archived on 2017-11-26.