Downloads
Power Query MRecordIntermediate

Record.RenameFields

Returns a copy of a record with some of its fields given new names.

Syntax
Record.RenameFields(record, renames, optional missingField)

Returns: A new record with the renamed fields. Values are unchanged.

What it does

Record.RenameFields changes the names of fields in a record, without touching the values. Use it to map an export's headers to your standard names, so that the same later steps work for every source. The renames are given as pairs: the old name and the new name.

Syntax and arguments

Example

Two banks send the same kind of statement with different headers. The query maps both to one standard name set.

let
    BankB = [#"Txn Date" = #date(2026, 3, 31), Amt = -1250, Desc = "Rent"],
    Standard = Record.RenameFields(BankB, {{"Txn Date", "Date"}, {"Amt", "Amount"}, {"Desc", "Description"}})
in
    Standard

Standard has the fields Date, Amount and Description. The values are the same as before, so the amount is still -1250.

Example: a second, different use

Renaming a record before it is added to a table, so that the table columns match the chart of accounts names used in the rest of the model.

Things to watch

In business terms

Standardizing bank, card and ERP headers so one set of steps can handle them all is common in reconciliations. Keep the rename list in one place, so the mapping can be reviewed as a control.

Related functions

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