Type.IsOpenRecord

Type

Returns true if the given record type is open — meaning it allows fields beyond those declared in the type.

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

Syntax

Type.IsOpenRecord(type as type) as logical

Parameters

NameTypeRequiredDescription
typetypeYesThe record type to test. Must be a type that is a record type.

Return Value

logicalTrue if the record type is open, false if it is closed.

Remarks

Type.IsOpenRecord tests whether a record type is open or closed. In Power Query M's type system, record types can be either:

- Open: the value may have additional fields beyond those declared in the type. The base type record is open by default. - Closed: the value must have exactly the declared fields — no more, no fewer undeclared fields are permitted.

Type.IsOpenRecord returns true for open record types and false for closed ones. Use this function before calling Type.OpenRecord or Type.ClosedRecord to avoid unnecessary conversions, or to branch logic based on whether a schema is fully specified.

A practical note: Type.ForRecord with isOpen = false (or omitted) creates a closed type. With isOpen = true it creates an open type. The base type record written as a literal is always open.

Use Type.OpenRecord and Type.ClosedRecord to convert between open and closed record types.

Examples

Example 1: The base record type is open

Type.IsOpenRecord(type record)
Result
Result
1TRUE

Example 2: A closed record type returns false

Result
Result
1FALSE

Example 3: Type.ForRecord is closed by default (isOpen = false)

let
    RT = Type.ForRecord([Name = [Type = type text, Optional = false]], false)
in
    Type.IsOpenRecord(RT)
Result
Result
1FALSE

Compatibility

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