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 blank field value and 'update'
Pages: [1]

Author Topic: Importing blank field value and 'update'  (Read 1680 times)

davesage

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 3
  • CiviCRM version: 3.4 & 4.1
  • CMS version: Joomla 1.5 & 2.5
  • MySQL version: 5.1
  • PHP version: 5.3
Importing blank field value and 'update'
July 08, 2011, 08:27:56 am
Hi,

Searched the forum but can;t find an answer to this issue.

I'm wanting to update addresses by importing the data using the 'update' option.

Say I have an address:

street address = 'x road'
Addtl Add 1 = 'y location'
Addtl Add 2 = 'z location'

I import:

Street address = 'new road'
Addtl Add 1 = 'new location'
Addtl Add 2 = ''

I'm finding that the record now looks like:

Street address = 'new road'
Addtl Add 1 = 'new location'
Addtl Add 2 = 'z location'


So the null field is not blanking the exisiting field but leaving it as it was?

There isn't an easy way for me to find these fields! I would expect it to update all fields when there is a match even when the import field is NULL - am I misunderstanding the situation?

Cheers,

Dave

ctarascio

  • I post frequently
  • ***
  • Posts: 334
  • Karma: 30
    • American Friends Service Committee
  • CiviCRM version: 4.1.3
  • CMS version: Drupal 6.26
  • MySQL version: 5.5.20
  • PHP version: 5.3.13
Re: Importing blank field value and 'update'
July 08, 2011, 09:47:35 am
hi dave,
what you want to do is currently not possible via the import/update process: http://forum.civicrm.org/index.php?topic=1558.0 i would imagine though, that if a make-it-happen initiative was started, that a lot of people would contribute.

hope this helps,
cynthia

davesage

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 3
  • CiviCRM version: 3.4 & 4.1
  • CMS version: Joomla 1.5 & 2.5
  • MySQL version: 5.1
  • PHP version: 5.3
Re: Importing blank field value and 'update'
July 08, 2011, 11:30:47 am
Hi Cynthia,

Thanks for the quick reply!

Do you know if anyone is using any sort of work around processes to identify the records where fields have not been blanked?

Seems as though the thread was from some time ago but maybe a MIH might move it forward - has anyone sized this? I presume it would an additional option on the 'update' import process to ask whether empty cells should leave or blank the current fields and then the changes to the actual import process to identify and do the appropriate action?

How can I find out whether there is enough momentum out there in the community to start this as a MIH?

Thanks though,

Dave

PS - the related - searching for empty/null fields is also something I ran into as a result of this first issue (I know it is a common issue in a lot of CRMs) I tkae it that has not moved forward? would this be a separate MIH?

ctarascio

  • I post frequently
  • ***
  • Posts: 334
  • Karma: 30
    • American Friends Service Committee
  • CiviCRM version: 4.1.3
  • CMS version: Drupal 6.26
  • MySQL version: 5.5.20
  • PHP version: 5.3.13
Re: Importing blank field value and 'update'
July 08, 2011, 01:15:35 pm
hi dave,
while i can envision a work around that uses sql to find and update fields that should have been blanked out, i do not know of any specific work around processes.

in answer to: How can I find out whether there is enough momentum out there in the community to start this as a MIH?. take a look at lobo's response to this post: http://forum.civicrm.org/index.php/topic,20569.msg86023.html#msg86023

i am not up on what is happening with the empty/null search issues so i can't help you there.

i'll look for your blog on the import/update enhancements :)

cynthia

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: Importing blank field value and 'update'
July 08, 2011, 02:42:49 pm
i can think of an awful workaround - before the import fill in all the blank fields in the csv with some string you won't find in any real records eg i always use qq
then after the import, run an sql to find and replace those with null/empty
is that bad or what?
i haven't done this for a civi import but in bad old days of other data management
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

davesage

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 3
  • CiviCRM version: 3.4 & 4.1
  • CMS version: Joomla 1.5 & 2.5
  • MySQL version: 5.1
  • PHP version: 5.3
Re: Importing blank field value and 'update'
July 09, 2011, 01:23:37 am
Thanks petednz - I just woke up this morning and thought I should import <null> or <blank> and then I could search for this string and update, I used to use this like you years ago when wanting to add smarty tag type merge fields then do a string replace - lol

Thanks for the pointer though.

What are your thoughts in terms of making an option on the import process to blank the fields? Maybe instead of having a parameter on the import form we could code it so that any instances of a known string like <blank> in the import was read and then used to blank the field - a bit like what you were suggesting but automate it? Messy but would give people the option of either leaving there import field blank (IE don't update) or <blank> and it nulls the field. This would allow for different records having different behavious but people would have to know to use the secret word, if you want for an option on import it would be clearer and no need to edit the file but would do blanket option across all the blank fields?

Cheers,

Dave

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • Importing blank field value and 'update'

This forum was archived on 2017-11-26.