Table.ToRows

Table

Converts a table into a list of lists, where each inner list contains the row values.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

Table.ToRows(table as table) as list

Parameters

NameTypeRequiredDescription
tabletableYesThe table to convert into a list of row-value lists.

Return Value

listA 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
    Rebuilt

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks