Record.FromList
A record made from a list of values and the names to give them.
Group: Record. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
Record.FromList(list as list, fields as any) as record
| Parameter | Type | Description |
|---|---|---|
list | list | The values, in order. |
fields | any | The field names: a list of texts, a record type, or a record whose field names are used. |
Returns
record. One field per value.
Remarks
- The list and the names must be as many, and each name may come once: otherwise an error.
Examples
Values and names
Record.FromList({1001, "Oslo", 120}, {"Order", "Shop", "Total"})
[Order = 1001, Shop = "Oslo", Total = 120]
Names from a record type
Record.FromList({1001, "Oslo"}, type [Order = number, Shop = text])
[Order = 1001, Shop = "Oslo"]