Skip to main content
Version: V3 (Ignition 8.3)

tamaki.mes.utils.excelFileToDS

Description

Converts a single sheet of an uploaded Excel file into an Ignition Dataset using Apache POI. The first row of the sheet is treated as the header row and supplies the dataset's column names. Each subsequent row is read cell-by-cell, with numeric, string, boolean, and blank cell types handled appropriately (whole numbers are coerced to integers; blank cells become None).

Typically used with the Perspective File Upload component.

Syntax

tamaki.mes.utils.excelFileToDS(excelFile, sheetNum)

Parameters

ParameterTypeNullableDescription
excelFileUploadedFileFalseThe uploaded Excel file (for example from the Perspective File Upload component). Must have a header row.
sheetNumIntegerFalseThe zero-based index of the sheet to convert.

Returns

A Dataset whose columns are taken from the header row and whose rows are the sheet's data rows.

Code Examples

# In the File Upload component's onFileReceived event
ds = tamaki.mes.utils.excelFileToDS(event.file, 0)
self.getSibling("Table").props.data = ds