Table.ToRecords

Table

Converts a table to a list of records, one record per row.

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

Syntax

Table.ToRecords(table as table) as list

Parameters

NameTypeRequiredDescription
tabletableYesThe table to convert.

Return Value

listA list of records where each record corresponds to a row in the table.

Remarks

Table.ToRecords is the inverse of Table.FromRecords. Each row becomes a record with field names matching the column names. This is useful when you need to iterate over rows as records or pass table data to a function expecting a list of records.

Examples

Example 1: Convert a table to a list of records

let
    Records = Table.ToRecords(Sales),
    First   = Records{0}
in
    First
Applied Steps

The final output — retrieves the first record from the list (zero-based index 0), exposing the first Sales row as a record with all its field values.

OrderID
CustomerID
Amount
Region
OrderDate
Category
Quantity
11,001C001250East1/15/2024Electronics5

Example 2: Round-trip via records

let
    Records   = Table.ToRecords(Sales),
    BackToTable = Table.FromRecords(Records)
in
    BackToTable

Compatibility

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