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.phppasses cells through as raw strings.packages/Webkul/DataTransfer/src/Helpers/Importers/Persons/Importer.phpparsedRowData()(~line 490) doesjson_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) enforcesemails.*.valuerequired|email andemails.*.labelrequired|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):
- Plain value —
[email protected]/5454445454(implicitlylabel=work). - Separator-separated list —
[email protected],[email protected]or;-separated for phone. - Optional explicit label — e.g.
[email protected] (work),[work] [email protected], or[email protected]|homestyle — 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
personsimporter first;leadsandproducts(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)
Source: krayin/laravel-crm