Record.Field
RecordReturns the value of a specific field from a record.
Syntax
Record.Field(record as record, field as text) as anyParameters
| Name | Type | Required | Description |
|---|---|---|---|
record | record | Yes | The record to retrieve the field value from. |
field | text | Yes | The name of the field to return. |
Return Value
any — The value of the specified field.
Remarks
Record.Field retrieves the value of a single field by name from a record. This is the functional equivalent of bracket-access notation (record[FieldName]), but allows the field name to be supplied dynamically as a text value — which is useful when field names are computed at runtime or stored in a variable.
Examples
Example 1: Get the Product from the first Sales row
let
ProductValue = Record.Field(Sales{0}, "Product")
in
#table({"Product"}, {{ProductValue}})Result
Product | |
|---|---|
| 1 | Widget A |
Compatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks