Downloads
Power Query MRecordIntermediate

Record.FromTable

Builds a record from a table with a Name column and a Value column.

Syntax
Record.FromTable(table)

Returns: A record with one field for each row of the table.

What it does

Record.FromTable is the reverse of Record.ToTable. Each row of the table becomes one field of the record: the value in the Name column becomes the field name and the value in the Value column becomes its value. Use it when settings or mappings are kept in a small table, and a query needs to look them up by name.

Syntax and arguments

Example

A settings table holds the parameters for a month-end query: the period, the entity and the approval limit. The query reads them by name.

let
    Settings = #table(
        {"Name", "Value"},
        {{"Period", "2026-03"}, {"Entity", "Northwind US"}, {"ApprovalLimit", 5000}}
    ),
    Config = Record.FromTable(Settings),
    Limit = Config[ApprovalLimit]
in
    Limit

Config is a record with three fields, and Limit is 5000. The query uses the names rather than the row numbers, so adding a setting later does not break the lookups.

Example: a second, different use

Turning a two-column mapping table into a lookup record, so that a code can be translated with Mapping[code].

Things to watch

In business terms

Keeping parameters, mappings and tolerances in a small visible table is good control practice, because a reviewer can read and change them without editing code. Record.FromTable lets the query use that table as named settings.

Related functions

All Power Query M functions · View as Markdown · M basics