CRM · Customer CSV import

Bulk customer create/update from a CSV: the operator uploads the file, maps each CSV column to one of ~40 user attributes, picks the match key (id / email / VAT number), separator, date format, consent defaults and channels, then runs the import.

AreaCRM
Routescrm.users.import
Centre modulescrm
Staff levelsroot · admin
Modelscampaign · channel · load · user · user-account-type
UI labelimport-csv.column-database
Coverage3 use cases · 1 happy · 7 failure

How it works

The mapping table auto-matches CSV headers whose text equals an attribute value, so a template-shaped file needs no manual mapping. modelExample serves a different downloadable template when the centre has employee segments (baseContentCreatorCSV(userTypeCodes) instead of baseCSV). Validation lives on the load model: no duplicate column mappings, a date format when register_date/bdate are mapped, and at least one channel when importing users. nf-import adds a pre-flight (_validateSelectionsAndShowErrors) that collects the same issues into a summary banner before the model validation runs, and update: true controls insert-only vs update-and-insert.

Use cases

Why someone opens this (3)

  • Onboarding a centre by loading its historical customer database.
  • Periodic sync from a POS or legacy CRM keyed on email or VAT number.
  • Bulk-assigning user tags or account types to an existing population.

Path map

flowchart LR
    F(["Customer CSV import"]):::feat
    F --> H1["Template-shaped import"]:::ok
    F -.-> X1["Same attribute mapped twice"]:::bad
    F -.-> X2["Date columns without a format"]:::bad
    F -.-> X3["No channel selected"]:::bad
    F -.-> X4["Required selections incomplete"]:::bad
    F -.-> X5["Server-side row errors"]:::bad
    F -.-> X6["Malformed CSV / wrong separator"]:::bad
    F -.-> X7["Upload rejected"]:::bad
    classDef feat fill:#157068,stroke:#157068,color:#ffffff,font-weight:bold
    classDef ok fill:#e3f1ea,stroke:#0d6b42,color:#0d4a2e
    classDef bad fill:#f7e6e2,stroke:#9a2d1c,color:#6e1f13

Happy paths

Template-shaped import

  1. Operator downloads the example CSV, fills it and uploads it.
  2. The file is parsed (csv.parseCSV, ; delimiter) and simultaneously uploaded to storage (apiFiles.uploadFile).
  3. Columns auto-map; operator picks the match key, date format and channels.
  4. load.validate() passes, load.save() queues the job and the success state is reported.

Failure paths

QA checklist

Tick these off while regression-testing this feature. The boxes are plain Markdown, so progress is visible in git diffs.

  • ✅ Template-shaped import
  • ⛔ Same attribute mapped twice
  • ⛔ Date columns without a format
  • ⛔ No channel selected
  • ⛔ Required selections incomplete
  • ⛔ Server-side row errors
  • ⛔ Malformed CSV / wrong separator
  • ⛔ Upload rejected

Implementation


Generated from doc/feature-inventory.json · id crm-customer-import · commit 276788ca6