Type.IsNullable
TypeReturns true if the given type is a nullable type — one that can hold null values.
Syntax
Type.IsNullable(type as type) as logicalParameters
| Name | Type | Required | Description |
|---|---|---|---|
type | type | Yes | The type to test. |
Return Value
logical — True if the type is nullable, false otherwise.
Remarks
Type.IsNullable returns true when a type is a nullable type — one that permits null values. In Power Query M, nullable types are expressed using the nullable keyword: type nullable number, type nullable text, and so on.
The primitive types such as type number and type text are non-nullable by default — they are distinct type values from type nullable number and type nullable text. Most built-in Power Query M functions accept and return nullable variants of their parameter types (e.g., the number parameter of Number.Round is typed as nullable number), meaning they gracefully handle null inputs.
Type.IsNullable is useful when:
- Inspecting column types programmatically to decide whether null-handling is needed
- Building generic transformation functions that behave differently for nullable vs non-nullable fields
- Validating that a type annotation includes a nullable wrapper before applying Type.NonNullable to strip it
To make a type non-nullable, use Type.NonNullable. To make a type nullable, use the type nullable X expression — there is no dedicated Type.Nullable function.
Examples
Example 2: A non-nullable primitive type returns false
Type.IsNullable(type number)Result | |
|---|---|
| 1 | FALSE |
Example 3: Inspect the nullability of the type of a literal value
let
ColType = Value.Type(42),
IsNullable = Type.IsNullable(ColType)
in
IsNullableThe final output — checks whether the type of 42 is nullable using Type.IsNullable, returning false because type number does not allow null.
Result | |
|---|---|
| 1 | FALSE |