Record.FieldNames
RecordReturns a list of field names from a record.
Syntax
Record.FieldNames(record as record) as listParameters
| Name | Type | Required | Description |
|---|---|---|---|
record | record | Yes | The record whose field names to return. |
Return Value
list — A list of text values representing the field names.
Remarks
Record.FieldNames returns the field names of a record as a list of text values. The names are returned in the same order they appear in the record. This is useful for inspecting the structure of a record or dynamically iterating over its fields. To access a single row as a record from a table, use the table{index} syntax — for example, Sales{0} returns the first row as a record.
Examples
Example 1: Get field names from the first Sales row
let
FirstRow = Sales{0},
Names = Record.FieldNames(FirstRow)
in
#table({"FieldName"}, List.Transform(Names, each {_}))Result
FieldName | |
|---|---|
| 1 | OrderID |
| 2 | CustomerName |
| 3 | Product |
| 4 | Category |
| 5 | UnitPrice |
| 6 | Quantity |
| 7 | OrderDate |
| 8 | Region |
Compatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks