Type.FunctionParameters

Type

Returns a record of parameter types for a given function type.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

Type.FunctionParameters(type as type) as record

Parameters

NameTypeRequiredDescription
typetypeYesA function type whose parameter types are returned.

Return Value

recordA record where each field name is a parameter name and each value is the parameter's type.

Remarks

Type.FunctionParameters returns a record describing the parameter types of a function type. Each field in the result corresponds to one parameter: the field name is the parameter name, and the value is the parameter's declared type. The order of fields in the result matches the parameter order in the function signature.

This function operates on a function type — not a function value directly. To get the type of an existing function value, use Value.Type(myFunction) first, then pass the result to Type.FunctionParameters.

Type.FunctionParameters is used in metaprogramming scenarios such as runtime signature inspection, documentation generation, or building generic pipelines that adapt their behavior based on the parameters a function accepts. For related introspection, use Type.FunctionReturn to get the return type and Type.FunctionRequiredParameters to determine how many parameters are required.

Note that optional parameters appear in the result with their declared type just like required parameters — to distinguish required from optional, check the count returned by Type.FunctionRequiredParameters.

Examples

Example 1: Get parameter types of a simple function type

let
    FType = type function (x as number, y as text) as logical
in
    Record.ToTable(Type.FunctionParameters(FType))
Result
Name
Value
1xtype number
2ytype text

Example 2: Inspect parameter types of a built-in function

Result
Name
Value
1numbertype nullable number
2digitstype nullable number
3roundingModetype nullable number

Example 3: Count the total parameters of a function

Result
Result
15

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks