Transforms the given Excel file into internal structure.
-
Input:
InputStream— the Excel file content (XLS or XLSX). -
Output:
List<Map<String, String>>— a list of rows, where each row is a map of column name to value.
The format of the input (XLS vs XLSX) is automatically detected using Apache POI's FileMagic (stream-safe detection via mark/reset since PFIMCORE-2862).
Properties
|
Option |
Type |
Default |
Since |
Description |
|---|---|---|---|---|
|
|
Boolean |
|
IM 1.1.18 |
Indicates whether the input contains a header record (must be on the first row). |
|
|
Boolean |
|
IM 1.1.18 |
Determines whether to skip the header record in the output. |
|
|
String |
|
IM 1.1.18 |
Comma-separated list of headers to use. When |
|
|
Integer |
|
IM 1.1.18 |
Index of the sheet with the required data. |
|
|
String |
|
IM 1.1.18 |
Name of the sheet with the required data. If filled, takes precedence over |
Numeric Value Handling (since PFIMCORE-2881, March 2026)
Cell values are extracted with the following rules:
|
Cell Type |
Handling |
|---|---|
|
STRING |
Returned as-is |
|
BOOLEAN |
Converted to |
|
NUMERIC (whole number) |
Converted to long if within |
|
NUMERIC (decimal) |
Formatted using |
|
NUMERIC (NaN / Infinity) |
Returned as |
|
NUMERIC (date) |
Formatted as date string |
|
BLANK / OTHER |
Empty string |
Examples
Transform Excel file into internal representation (default)
<to uri="pfx-excel:unmarshal"/>
Transform Excel file without header
<to uri="pfx-excel:unmarshal?header=sku,name&hasHeaderRecord=false"/>
Read from a specific sheet by name
<to uri="pfx-excel:unmarshal?sheetName=Products"/>
Common Pitfalls
-
All values return as strings — Numeric cells are converted to string representation. If you need typed values in Pricefx, use converters in your mapper (e.g.,
stringToDecimal,stringToInteger). -
Header row consumed — When
hasHeaderRecord=true(default), the first row is used as column names and is not included in the output data. If your file has no header, sethasHeaderRecord=falseand provideheader=col1,col2,.... -
Multi-sheet files — By default only sheet index 0 is read. Use
sheetNameorsheetIndexto target a different sheet. There is no built-in way to read all sheets in one call — create separate routes or use Groovy for multi-sheet processing. -
Large files —
unmarshalloads the entire file into memory. For files with 10k+ rows, usestreamingUnmarshalinstead.