import_from_csv
Validates a CSV or Excel file of EBMS records, maps columns to fields, flags invalid or duplicate rows, and drafts read-only ebms_write calls plus an exceptions workbook for rows needing fixes.
Instructions
Review a CSV or Excel (.xlsx) file of records for one EBMS entity — products, units, vendor records, bills of materials, customers, vendors, workers, folders, tax rates or other configuration — and draft the writes, read-only. Maps each column to a field (from EBMS's live metadata), checks every row (blanks, types, lengths, duplicates, folders, vendors, products and units that do not exist), skips rows already in EBMS or already created by an earlier run of the same import, writes an exceptions workbook holding only the rows that need fixing, and returns the exact ebms_write call for each remaining row. It writes nothing to EBMS. Follow the ebms-import skill: show the mapping, problems and a few drafts, get one clear yes for the file, then call ebms_write for each draft in order. Run it again on the same file (or the corrected exceptions file) to continue: what was created is skipped.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| csv | No | The file's CSV text, as the user attached or pasted it. | |
| path | No | Path of the file on this computer: .csv, .tsv, .txt or .xlsx (also an exceptions workbook this tool wrote), up to 20 MB. Hidden files and settings folders are refused. Give this or csv. | |
| sheet | No | For a workbook with several sheets: the one to read. Default: the first. | |
| entity | Yes | What the file holds: INVENTRY products; INVENUNT units, INVENDOR vendor records, INVENDET bill-of-materials lines (each row names its product in ID); ARCUST customers; APVENDOR vendors; PYEMP workers; INVENTRE / ARCUSTRE / APVENTRE / PYEMPTRE / PYWORKTRE folders; ARTAX tax rates; or a configuration set. | |
| rowsTo | No | ||
| company | Yes | Required. Company, by ID or name. | |
| mapping | No | Header -> field, overriding the automatic match. Map a header to "" to leave the column out. | |
| defaults | No | Field -> value for every row whose cell is blank or whose column is missing, e.g. {"TREE_ID": "26", "C_TYPE": 2}. Only what the user chose: never a guessed folder or classification. | |
| importId | No | Continue an earlier import of the same records from a renamed file: the importId an earlier result gave. Or, when a result reports rows where an earlier run created a different record and the user confirms this is a new file, the newImportId that result offered. | |
| rowsFrom | No | First row number to draft (validation always covers the whole file). | |
| maxDrafts | No | At most this many drafts in one result. Default 200. | |
| failedRows | No | Rows whose ebms_write failed in this import, with what EBMS said: they go to the exceptions workbook instead of being drafted again. | |
| exceptionsTo | No | Only a path the user named: an .xlsx file to save the exceptions workbook as. Default: beside the file as <name>.exceptions.xlsx. |