Import CSV or Excel records
Enable the table import wizard for end users. The following complete module definition and index layout expose a small contacts table with import enabled. Syntax is verified against BakeryResourceModule and the SPA ResourceTableComponent; the wizard scenario has not been executed here.
Copy the Bakery definitions into the system directory, inspect php bakery plan <system>, then apply them in a disposable preview with php bakery apply <system>. A client must already exist.
modules/import_contacts/import_contacts.module.bake.json:
[ { "resource_module": "import_contacts", "resource": { "identifier": "import_contacts", "title": "name", "fields": [ { "identifier": "name", "type": "text" }, { "identifier": "email", "type": "email" } ], "importable": true, "layouts": { "index": "/modules/import_contacts/import_contacts.index" } } }]modules/import_contacts/import_contacts.index.json:
{ "tabs": [ { "identifier": "general", "rows": [ { "cols": [ { "span": 24, "components": [ { "type": "resource_table", "options": { "module": "import_contacts" } } ] } ] } ] } ]}How it works
Section titled “How it works”Open /import_contacts in the preview and choose Import from the table toolbar. Upload a CSV/Excel file, map its columns and review the options. Do not disable toolbar.import. The module-header shortcut is not the supported UI entry. Field-level options.importable can exclude individual fields. Imports require the actor’s appropriate access rights; enabling the wizard grants no permissions.
Test it
Section titled “Test it”Import a two-row file with name,email headers; confirm both records and test invalid email handling. Check duplicate handling with your chosen import options. The built-in wizard is not covered by a workflow trigger. For a custom import workflow, assert resulting values and counts; a verified file-fixture setup for that scenario is still missing.
Other ways
Section titled “Other ways”- Recommended for repeatable formats with business logic: file →
action/import→ per-rowsource/new/op/set/action/save. Types include csv/xls/xlsx; configure delimiter, encoding, offset andhasHeaderRow. Complete file-fixture tests remain unverified. - Recommended for assisted extraction from unstructured text/images:
ai/entityFromText/ai/entityFromImage, followed by review. Only element availability was audited; the complete extraction pattern is unverified. Not recommended as a deterministic spreadsheet import. - Not recommended for setting imported values: relying on ordinary
beforeSavemutations. Use defaults, field recipes or explicit saved follow-up logic.
Reference
Section titled “Reference”Module schema · Import fields · Import action · Workflow tests · Assertions