Enhancement: accept plain values for emails/contact_numbers in CSV imports instead of JSON wrapping

Author: sagarkumar-webkulCreated Aug 10, 2026Updated Aug 14, 2026
LabelsEnhancement

Summary

Community feedback (from an import workflow with custom attributes): imports work, but requiring emails and phone numbers to be wrapped in JSON is awkward for a spreadsheet:

emails
"[{""label"": ""work"", ""value"": ""[email protected]""}, {""label"": ""home"", ""value"": ""[email protected]""}]"

Most other CRMs let users type a plain email/phone (or a simple separator list) in the CSV. Since imports are infrequent this is tolerable, but a friendlier format would be a big usability win.

Current behaviour

  • packages/Webkul/DataTransfer/src/Helpers/Sources/CSV.php passes cells through as raw strings.
  • packages/Webkul/DataTransfer/src/Helpers/Importers/Persons/Importer.php parsedRowData() (~line 490) does json_decode($rowData['emails'], true) / json_decode($rowData['contact_numbers'], true) — so the value must be the JSON array form [{"label":"work","value":"..."}].
  • Validation (validateRow(), ~line 178) enforces emails.*.value required|email and emails.*.label required|in:home,work, so any plain value is rejected.
  • The downloadable sample (storage/app/public/data-transfer/samples/persons.csv) documents this JSON format.

Proposal

Accept these simpler formats for emails and contact_numbers (and normalise them internally before validation/saving):

  1. Plain value[email protected] / 5454445454 (implicitly label=work).
  2. Separator-separated list[email protected],[email protected] or ;-separated for phone.
  3. Optional explicit label — e.g. [email protected] (work), [work] [email protected], or [email protected]|home style — while keeping backward compatibility with the existing JSON format (so old files keep working).

If none of the formats parse, keep the current clear row validation error.

Impact

  • Applies to the persons importer first; leads and products (email/phone-like attributes) can follow the same normalisation helper.
  • Must stay backward-compatible with the existing JSON form documented in the sample.

Related

  • Sample file showing current format: storage/app/public/data-transfer/samples/persons.csv
  • Prior related import issues: #2629 (process-in-queue switch), #2630 (date attribute formats), #2631 (duplicates + select attribute labels)