Table.FromRecords

Table

Creates a table from a list of records.

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

Syntax

Table.FromRecords(records as list, optional columns as any, optional missingField as nullable number) as table

Parameters

NameTypeRequiredDescription
recordslistYesA list of records to convert into table rows.
columnsanyNoA list of column names, a table type, or a number of columns. Controls the output column structure.
missingFieldnumberNoControls behavior when a record is missing a field. Use MissingField.Error (default), MissingField.Ignore, or MissingField.UseNull.

Return Value

tableA table where each record in the list becomes a row, with field names as column names.

Remarks

Table.FromRecords converts a list of records into a table. Each record becomes a row, and each field name becomes a column. This is useful for building tables from JSON/API responses, or for constructing small lookup tables inline.

Pass a type table value as the columns parameter to define column names and types in one step. Use MissingField.UseNull when records have inconsistent fields — missing fields will be filled with null instead of raising an error.

Examples

Example 1: Round-trip records back to table

let
    Source = Table.SelectColumns(Table.FirstN(Sales, 3), {"OrderID", "CustomerName", "Product"}),
    AsRecords = Table.ToRecords(Source)
in
    Table.FromRecords(AsRecords)
Result
OrderID
CustomerName
Product
11AliceWidget A
22BobGadget B
33CharlieWidget C

Compatibility

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