Downloads
Power Query MRecordBeginner

Record.FieldNames

Returns the names of all the fields in a record, as a list of text.

Syntax
Record.FieldNames(record)

Returns: A list of text values, in the order the fields are defined.

What it does

Record.FieldNames lists the names of the fields in a record. For a table row, these are the column names. It is useful when you want to check that an export has the columns you expect, or when a function has to work on whatever columns a file happens to contain.

Syntax and arguments

Example

A monthly export sometimes includes an extra column. Before the file is loaded, the team wants to see the column list of the first row.

let
    FirstRow = [Date = #date(2026, 3, 31), Account = "1000", Amount = 1250],
    Names = Record.FieldNames(FirstRow)
in
    Names

Names is {"Date", "Account", "Amount"}. Comparing this list with the expected headers catches a missing or renamed column early, before totals go wrong.

Example: a second, different use

Checking for a required field: List.Contains(Record.FieldNames(Row), "Amount") returns true when the row has an Amount field.

Things to watch

In business terms

Schema checks on monthly files are a common control: the reviewer expects the same column set every month. Recording the list of names in the close notes shows that the file layout was checked.

Related functions

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