Record.FromTable
A record built from a table of Name and Value columns: the reverse of Record.ToTable.
Group: Record. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
Record.FromTable(table as table) as record
| Parameter | Type | Description |
|---|---|---|
table | table | A table with a Name column (the field names, as text) and a Value column. |
Returns
record. A field per row, in the table's order.
Remarks
- A table without both columns gives an error, and so does a name on two rows: a record has each field once.
Examples
Settings kept as rows
Record.FromTable(#table({"Name", "Value"}, {{"Order", 1001}, {"Shop", "Oslo"}}))
[Order = 1001, Shop = "Oslo"]
A name twice
Record.FromTable(#table({"Name", "Value"}, {{"Order", 1001}, {"Order", 1002}}))
Result: an error.
[Reason = "Expression.Error", Message = "The field 'Order' already exists in the record.", Detail = null]