Record.RenameFields
Returns a copy of a record with some of its fields given new names.
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
record: the record to change.renames: a list of pairs, each a list with the old name and the new name, such as{{"Amt", "Amount"}, {"Desc", "Description"}}.missingField(optional): what to do if an old name is not in the record. The default is an error.MissingField.Ignoreskips it quietly.
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
- The old name must match exactly, including spaces and capital letters. A field name with a space is written
#"Txn Date"where you define it. - Renaming does not change the values. Convert types with Record.TransformFields if needed.
- Use
MissingField.Ignorewhen some exports lack an optional column, so the query does not stop. - For a table, Table.RenameColumns does the same job on the whole table.
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.