Record.ToTable

Record

Converts a record into a two-column table with columns Name and Value.

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

Syntax

Record.ToTable(record as record) as table

Parameters

NameTypeRequiredDescription
recordrecordYesThe record to convert to a table.

Return Value

tableA table with two columns — Name (text) and Value (any) — one row per field.

Remarks

Record.ToTable converts a record into a two-column table with columns Name (text) and Value (any). Each field in the record becomes one row. Row order matches the field order in the record.

This is the inverse of Record.FromTable. Common uses include:

- Inspection: displaying all fields of a record in a structured table view - Finding nulls: filtering the resulting table for rows where [Value] = null - Dynamic field iteration: applying Table.SelectRows, Table.AddColumn, or other table operations across all fields without knowing them by name

The Value column has type any because records can contain fields of mixed types. After converting to a table, you can filter, sort, or transform by field name using standard table functions.

Examples

Example 1: Convert a record to a two-column Name/Value table

Record.ToTable([Name = "Alice", Age = 30, City = "New York"])
Result
Name
Value
1NameAlice
2Age30
3CityNew York

Example 2: Inspect all fields of the first Sales row

Record.ToTable(Sales{0})
Result
Name
Value
1OrderID1
2CustomerNameAlice
3ProductWidget A
4CategoryWidgets
5UnitPrice25
6Quantity4
7OrderDate2024-01-15
8RegionEast

Example 3: Find which fields in a record contain null values

let
    Row = [OrderID = 1, CustomerName = null, Product = "Widget A", Notes = null],
    AsTable = Record.ToTable(Row),
    NullFields = Table.SelectRows(AsTable, each [Value] = null)
in
    NullFields
Applied Steps

The final output — a table listing only the fields from the record that contain null values.

Name
Value
1CustomerNamenull
2Notesnull

Compatibility

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