Announcement

Collapse
No announcement yet.

CSV Import - How to overwrite existing data with empty fields?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • CSV Import - How to overwrite existing data with empty fields?

    Hello everyone,

    I'm facing an issue with CSV imports in EspoCRM. While creating new records works perfectly fine, I'm having trouble with updating existing records.
    My specific problem:
    • When I import a CSV file to update existing records
    • If a cell is empty in my CSV file
    • And the corresponding field in EspoCRM contains data
    • The existing data is not overwritten/cleared by the empty value

    Example:
    • An existing record has "Phone: 123456789"
    • In my CSV import file, the phone field is empty
    • After import, the phone number remains "123456789" instead of being cleared

    Is there a specific setting or method to force EspoCRM to overwrite existing data with empty values during CSV imports?

    Any help or guidance would be greatly appreciated.
    Thank you in advance!​

  • #2
    Maybe there will be a more elegant way, but here is my proposal:

    1. In your entity, to which you want to import, create a new text-field and call it phone2 (or alike). In my example the original field is named phoneNumber.
    2. Map your phone number from the CSV file to that field. This way you will have phone2 with number or without.
    3. Create a formula:

    Code:
    ifThenElse)
    phone2 == ' ',
    phoneNumber = null,
    phoneNumber = phone2
    );
    On executing this formula after having imported, it should copy the number from phone2 to phoneNumber. If phone2 is empty, it should set the phoneNumber to empty as well.

    Comment

    Working...
    X