Record.FieldNames
Returns the names of all the fields in a record, as a list of text.
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
record: the record to inspect, such as a row of a table, or a record you built.
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
- The names are text, and they keep their capitals.
- For a table, Table.ColumnNames gives the same list without you first picking a row.
- A record built from a table row has the names of that table's columns only.
- The list is in definition order, so do not rely on it for sorting.
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.