Type.TableRow
TypeReturns the row type of a table type.
Syntax
Type.TableRow(table as type) as typeParameters
| Name | Type | Required | Description |
|---|---|---|---|
table | type | Yes | A table type to extract the row type from. |
Return Value
type — The record type representing a single row of the table type.
Remarks
Type.TableRow extracts the row type (a record type) from a table type. The returned record type describes the structure of a single row — its field names and their types.
For example, given type table [Name = text, Age = number], Type.TableRow returns a record type equivalent to type [Name = text, Age = number].
This is useful for:
- Introspecting table schemas programmatically.
- Building generic functions that adapt to the structure of their input tables.
- Combining with Type.ForFunction to construct function signatures dynamically.
If the input type is not a table type, the function raises an error.
Examples
Example 1: Inspect row type of a table type
let
MyTableType = type table [Name = text, Score = number],
RowType = Type.TableRow(MyTableType),
IsRecord = Type.Is(RowType, type record)
in
#table({"TableType", "RowType IsRecord"}, {{"type table [Name, Score]", IsRecord}})Result
TableType | RowType IsRecord | |
|---|---|---|
| 1 | type table [Name, Score] | TRUE |
Compatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks