Import Excel Test Data
Last updated on November 24, 2026
Excel is a tabular format: your column names are arbitrary, so you tell TofuPilot which column feeds each field. That column mapping is the schema. Save it once as a template and every later workbook with the same layout imports in one click.
Excel and CSV share the same column-mapping engine, so everything below applies to both.
| Encoding | Excel workbook (Open XML) |
|---|---|
| Extension | .xlsx |
| Detection | Needs mapping (you map columns to fields) |
| Origin | Microsoft Excel, shares the CSV mapping engine |
| Maps to | Run, phases, measurements, limits, unit, custom metadata |
| Runs per file | One or many |
| API import | POST /v2/imports/tabular (with a mapping), or the dashboard import page |
Prerequisites
- An Excel workbook (
.xlsx) with a header row. - A Procedure to attach the runs to, created in the dashboard. The procedure is chosen on the import page and always overrides any procedure named in the file.
How tabular import works
A workbook has no fixed shape, so you tell TofuPilot what each column holds. Mapping happens on the full import page, with your file in front of you.
- Upload. Drop the
.xlsxfile on the import page. The row shows Needs mapping. - Map. Click the row. The file opens as a grid of its first rows, one column per column of your file. Each column has a role: serial number, time, outcome, measurement, metadata, sub-unit, or ignore. TofuPilot fills the roles from the column names and values, or applies a saved template whose columns the file has; check each one.
- Preview. Click Preview to see how many runs the file makes, which rows would fail and why (grouped by reason), and the first runs as they will be stored. Nothing is written.
- Import. Click Use this mapping, then Import. A large file is imported in batches with its progress shown. Open the file afterwards for its results: runs created, rows that failed and why, downloadable as CSV.
Select several columns to give them one role at once, or to group numbered columns (cell_min_v_1, cell_min_v_2…) into one phase per number. Click a column name to set its measurement name, units, limits and phase, or its metadata key.
Runs per file
A file can hold one run or many. Choose how rows become runs in the Runs setting of the import page, or with runsPer in an API mapping.
| Runs | runsPer | Use it for | Rules |
|---|---|---|---|
| Per file | file (default) | One test report per file, often one measurement per row. | Every row carries the same serial number. A file with several is refused. |
| Per row | row | A bench log that appends one row per test. | Each row is a run, with its own serial, part, revision and batch. A retested unit gets one run per row. Needs the wide or none measurement layout. |
| Per serial | serial | One measurement per row, several units in the file. | The rows of each serial number (compared case-insensitively) make one run. |
With per row and per serial, each run is checked and created on its own. A bad row, such as an unknown outcome, an unreadable date or a missing sub-unit, creates no run and is reported with its row number. The other rows are imported. Row numbers count data rows: the header row and blank rows are not counted.
Repeated column groups
A tester that writes several modules per row repeats a group of columns: module_barcode_1, cell_min_v_1, then module_barcode_2, cell_min_v_2. Map them as wide measurement columns and give each group its own phase (Module 1, Module 2), with the same measurement name in every phase. Empty cells create no measurement, so a row with fewer modules creates fewer phases.
Import a growing log again
Bench testers often append one row per test to the same file. Upload the whole file again whenever you like: the runs an earlier import created are skipped, and only the new rows become runs. The import page shows how many runs are new and how many were already imported, before and after the import.
| Runs | A run is recognized by | A row edited after its import |
|---|---|---|
| Per row | The serial number and the test time, as written. The same test in two exports with different columns, such as a per-lot file and a summary file with one more column, is one run. Two tests with the same serial and time, such as two tests on the same day with a date-only time, stay two runs. | Skipped and listed as changed. |
| Per serial | The serial number. | Skipped and listed as changed: rows appended to a serial already imported are not added to its run. |
| Either, with run key columns | The values of the columns you pick, such as the serial number and the test time. | Skipped and listed as changed. The existing run is never overwritten: delete it and import again to replace it. |
The mapping is not part of it: importing the same rows with another template, or after mapping one more column, does not import them again. The same rows imported into another procedure are new runs there. Pick the run key columns under Recognize runs already imported by in the Runs card, or set runKeyColumns in an API mapping. Choose them before the first import: runs created with another key are not recognized.
Sub-units
Map one or several columns to Sub-unit in the Unit section, or list them in subUnitColumns. Each non-empty cell links that unit as a sub-unit of the row's unit, the same way as sub_units on run creation. Empty cells are skipped.
A sub-unit must already exist. Import the sub-units' own runs first (the module test log before the tray log), then the assembly. A row naming a unit that does not exist fails with Sub-unit not found: <serial>, and no unit is created for it, so a typo never creates a phantom unit. The preview lists those rows before anything is written.
When the log names parts that were never tested on their own, turn on Skip unknown sub-units in the Fixed values card (skipMissingSubUnits: true in an API mapping). The row's run is then created without the links to units that do not exist, and the preview and the import report how many links were left out. A sub-unit cell that can't be a serial number, with a space or more than 60 characters, is left out too. A sub-unit cell that holds the row's own serial is always left out: a unit cannot contain itself.
Time zones
Bench exports rarely write a UTC offset. Timestamps without one, such as 2026-07-08T15:49:48.349659 or 2026-07-08 15:49:48, are read as local time in the Time zone of the mapping (timeZone, an IANA name like Europe/Berlin), UTC when none is set. A date alone, such as 2025-03-10, is midnight in that zone. Digits past milliseconds are dropped.
| Cell | Time zone | Stored as (UTC) |
|---|---|---|
2026-07-08T15:49:48.349659 | none | 2026-07-08T15:49:48.349Z |
2026-07-08T15:49:48 | Europe/Berlin | 2026-07-08T13:49:48Z |
2025-03-10 | Europe/Berlin | 2025-03-09T23:00:00Z |
2024-01-15T10:30:00+02:00 | any | 2024-01-15T08:30:00Z |
A timestamp that carries an offset or Z, and an epoch number, is read as written, whatever the time zone.
Excel date cells carry no time zone either: they are read in the mapping's time zone, like a timestamp typed as text.
Field mapping
Map your columns to these run fields. Only serial number, outcome, started at, and ended at are required.
| TofuPilot field | Required | Description |
|---|---|---|
| Serial number | Yes | Identifies the Unit under test. Auto-creates the unit on first sight. |
| Outcome | Yes | Run pass/fail. Use a value map to translate your labels (for example Passed → PASS). |
| Started at | Yes | Run start timestamp. |
| Ended at | Yes | Run end timestamp. |
| Part number | No | Part the unit belongs to. |
| Revision number | No | Design Revision of the part. |
| Batch number | No | Production Batch. |
| Operated by | No | Operator who ran the test. An email matching a member of your organization links the run to that account. Any other value is recorded verbatim as a declared operator name. |
| Description | No | Free-text run note. |
Keep part of a cell
A tester sometimes writes an identifier with a label around it, such as LINE 2 TRAY 16S2P 2026C13-TR-001 where the other files write 2026C13-TR-001. A serial number can't hold spaces, so these rows fail as written. Next to the serial, part, revision or batch column, enter a pattern under Keep only: a regular expression whose first group, or whole match, is kept. The field shows what it gives on a value of the file. (\S+)$ keeps the last word. A cell the pattern does not match is used as written. In an API mapping, add extract to the field: { "column": "tray_barcode", "extract": "(\\S+)$" }.
Outcome value maps
Your file rarely uses TofuPilot's exact outcome labels. A value map translates each source value to a canonical outcome, so Passed, OK, and 1 can all map to PASS. The same applies to phase outcomes.
Measurements
A workbook stores measurements in one of two layouts. Pick the one that matches your file.
| Layout | Shape | Map |
|---|---|---|
| Long | One row per measurement, with a name column and a value column. | Name, value, and optional units, lower limit, upper limit, outcome, and phase columns. |
| Wide | One column per measurement, one row per run. | Each measurement column, with optional name, units, fixed lower/upper limits, and phase. |
| None | No measurements, just run-level pass/fail. | Nothing to map. |
Pass/fail steps
Bench logs often record each step as a result: PASS, FAIL, NOT_RUN. Map such a column as a measurement and open Value only next to it: turn on Pass/fail step and choose what each value means. PASS and FAIL set the measurement outcome, and Leave out skips the cell, for a step that did not run. A failed step fails its phase. The import page turns this on by itself for a column whose values are all step results. In an API mapping, add outcomeMap to the wide column: { "column": "can_result", "phase": "First test", "outcomeMap": { "PASS": "PASS", "FAIL": "FAIL", "NOT_RUN": null } }. A value the map does not name fails the row, so a new result word never passes unnoticed.
Phases
For the long layout you can map phase data carried on the measurement rows: a phase name column groups measurements into Phases, with optional phase outcome, started, and ended columns. When omitted, TofuPilot derives phase outcomes from their measurements and timing from the run.
Custom metadata
Map extra columns to typed metadata keys:
- Run metadata attaches the value to the run.
- Unit metadata attaches the value to the Unit under test (PATCH semantics, so it updates the unit).
Each side accepts up to 50 mapped columns.
Templates
Save a finished mapping with Save as template so the next workbook with the same layout maps itself. When a workbook's columns cover a template's, the import page applies it on opening. Update saves your changes to the template you applied.
A bench log often changes over time: a tester adds a column, another drops one. Turn on Columns a file lacks: Skip them (ignoreMissingColumns: true in an API mapping) and one template covers all the variants: a mapped column the file does not have is left out, and the preview lists it. The serial number, outcome and time columns, and the name and value columns of one measurement per row, are still required.
Import through the API
A workbook can also be imported with POST /v2/imports/tabular, one file per call. Upload the file, then send its upload_id, the procedure_id to attach the runs to, and a mapping that names the columns to read. The mapping takes the fields described above. The procedure in procedure_id always overrides any procedure named in the file.
# Import one workbook with an inline column mapping (long measurement layout)
curl -X POST https://www.tofupilot.app/api/v2/imports/tabular \
-H "Authorization: Bearer $TOFUPILOT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"upload_id": "550e8400-e29b-41d4-a716-446655440000",
"procedure_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
"mapping": {
"fields": {
"serial_number": { "column": "Serial" },
"part_number": { "column": "Part" },
"outcome": { "column": "Result", "valueMap": { "Passed": "PASS", "Failed": "FAIL" } },
"started_at": { "column": "Start" },
"ended_at": { "column": "End" }
},
"measurements": {
"layout": "long",
"nameColumn": "Test",
"valueColumn": "Value",
"unitsColumn": "Unit",
"lowerColumn": "Low",
"upperColumn": "High"
}
}
}'With one run per file, the endpoint returns the created run's id and its file_import_id. See the REST API reference for the full mapping schema, including the wide layout, phases and metadata.
Import a bench log with one run per row
Set runsPer to row. This tray log links the modules of each row as sub-units and reads its timestamps in Berlin time.
{
"runsPer": "row",
"timeZone": "Europe/Berlin",
"fields": {
"serial_number": { "column": "tray_barcode" },
"part_number": { "column": "project_name" },
"outcome": { "value": "PASS" },
"started_at": { "column": "timestep" },
"ended_at": { "column": "timestep" }
},
"subUnitColumns": ["module_barcode_1", "module_barcode_2", "module_barcode_3"],
"measurements": {
"layout": "wide",
"columns": [
{ "column": "cell_min_v_1", "name": "cell_min_v", "units": "V", "phase": "Module 1" },
{ "column": "cell_min_v_2", "name": "cell_min_v", "units": "V", "phase": "Module 2" }
]
}
}The response lists the runs it created in ids, in file order, and the rows that failed in row_errors, each with its row, serial_number and error. When every row of a request's 100 runs fails, the request goes on with the next ones, so the bad rows of a file never hide its good ones; it is refused, with the rows named, when no row left in the file creates a run, or after 300 runs failed at creation in one request. To go past refused rows without fixing them, send run_offset set to the end of the refused range given in the error. When the fix is outside the file, such as importing the module log first, send the same file again: the runs already imported are skipped, and the rows that failed are created. Rows an earlier import created are listed in skipped_rows, each with the run_id it created and a reason (already_imported, or changed for a row edited since, see Import a growing log again), and counted in skipped_row_count.
One request creates at most 100 runs. When the file has more, the response carries next_run_offset: send the same request with run_offset set to it, until the response has none. total_runs is the number of runs in the whole file. The dashboard import page does this for you and shows the progress.
# Import every run of a large bench log, 100 runs per request
from tofupilot.v2 import TofuPilot
client = TofuPilot(api_key="YOUR_API_KEY")
offset = 0
while offset is not None:
res = client.imports.tabular(
upload_id=upload_id,
procedure_id=procedure_id,
mapping=mapping,
run_offset=offset,
)
for e in res.row_errors or []:
print(f"row {e.row} ({e.serial_number}): {e.error}")
offset = res.next_run_offsetA run is never imported twice. Sending the same file again, after a timeout or after rows were appended to it, skips the runs it already created and does not count them toward the 100: a log that grew by a few rows imports them in one request. When every run of a request existed, the response returns them with already_imported: true and creates nothing. Set allow_duplicate to create every run again.
The structured formats (OpenHTF, WATS, ATML, NI TestStand, STDF, ATDF) use POST /v2/imports/structured instead, with no mapping.
With one run per file, importing the same file again creates a new run. With one run per row or per serial, the runs an earlier import created are skipped, unless allow_duplicate is set.
How is this guide?
CSV
Learn how to import CSV test results into TofuPilot by mapping your columns to runs, units, phases, and measurements, then saving the mapping as a template.
ATDF
Learn how to import ATDF semiconductor test datalogs into TofuPilot with automatic detection, the human-readable ASCII twin of the STDF binary format.