Table.FromRecords
TableCreates a table from a list of records.
Syntax
Table.FromRecords(records as list, optional columns as any, optional missingField as nullable number) as tableParameters
| Name | Type | Required | Description |
|---|---|---|---|
records | list | Yes | A list of records to convert into table rows. |
columns | any | No | A list of column names, a table type, or a number of columns. Controls the output column structure. |
missingField | number | No | Controls behavior when a record is missing a field. Use MissingField.Error (default), MissingField.Ignore, or MissingField.UseNull. |
Return Value
table — A 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 | |
|---|---|---|---|
| 1 | 1 | Alice | Widget A |
| 2 | 2 | Bob | Gadget B |
| 3 | 3 | Charlie | Widget C |
Compatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks