Table.ToRows
TableConverts a table into a list of lists, where each inner list contains the row values.
Syntax
Table.ToRows(table as table) as listParameters
| Name | Type | Required | Description |
|---|---|---|---|
table | table | Yes | The table to convert into a list of row-value lists. |
Return Value
list — A list of lists, where each inner list contains the values of one row in column order.
Remarks
Table.ToRows converts a table into a list of lists. Each inner list contains the cell values for one row, ordered by the table's column sequence. Column names are discarded — only the values are kept.
This is the inverse of Table.FromRows. Use it when you need positional access to row data rather than named field access (which Table.ToRecords provides).
Common uses include building custom serialization formats, passing row data to functions that expect flat lists, or interoperating with APIs that accept arrays of arrays.
Examples
Example 1: Convert Sales rows to nested lists
let
Subset = Table.SelectColumns(
Table.FirstN(Sales, 3),
{"OrderID", "Product", "Quantity"}
)
in
Table.ToRows(Subset)Example 2: Round-trip with Table.FromRows
let
Source = Table.FromRecords({
[Name = "Alice", Age = 30],
[Name = "Bob", Age = 25]
}),
Rows = Table.ToRows(Source),
Rebuilt = Table.FromRows(Rows, Table.ColumnNames(Source))
in
RebuiltCompatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks