OpenBI Docs Buy

Table.FromRecords

Makes a table from a list of records: each record a row, each field a column.

Group: Table. Power Query M has it too: a query that uses it is written as in Power BI.

Syntax

Table.FromRecords(records as list, optional columns as any, optional missingField as nullable number) as table
ParameterTypeDescription
recordslistThe rows as records.
columnsany
optional
The column names as a list, or a table type; the first record's fields when left out.
missingFieldnullable number
optional
MissingField.UseNull to give null where a record lacks one of the columns; an error otherwise.

Returns

table. A table with one row per record.

Remarks

  • Fields are matched by name: their order in each record doesn't matter.

Examples

Two products

Table.FromRecords({[Product = "Chair", Price = 50], [Price = 120, Product = "Desk"]})
ProductPrice
Chair50
Desk120

A missing field as null

Table.FromRecords({[Product = "Chair", Price = 50], [Product = "Desk"]}, {"Product", "Price"}, MissingField.UseNull)
ProductPrice
Chair50
Desknull

Table.ToRecords, Table.FromRows, Table.FromList, #table.

Last updated · OpenBI Studio 0.3.79