Downloads
Power Query MRecordBeginner

Record.Field

Returns the value of one named field in a record.

Syntax
Record.Field(record, field)

Returns: The value of the field. An error if the field does not exist.

What it does

A record is one row, with named fields. Record.Field reads one of those fields by name. You can also write row[Amount], which does the same thing. Use Record.Field when the field name is held in a variable, such as a name passed in from a parameter or a loop, because you cannot put a variable inside square brackets.

Syntax and arguments

Example

A function reads the amount from any row, but the column name changes between two bank exports: one calls it "Amount" and the other "Debit".

let
    ColumnName = "Amount",
    Row = [Date = #date(2026, 3, 31), Amount = 1250, Memo = "Rent"],
    Value = Record.Field(Row, ColumnName)
in
    Value

Value is 1250. Because the name is in a variable, Record.Field is the right tool. If the name were fixed, Row[Amount] would be shorter.

Example: a second, different use

Reading a field inside each when the column name comes from a list: each Record.Field(_, ColumnName) inside a List.Transform over a list of rows.

Things to watch

In business terms

Column names change between bank, ERP and card exports more often than people expect. A small function that takes the field name as an argument keeps one query working across those exports.

Related functions

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