BinaryFormat.Null

Binary

A binary format that reads zero bytes and returns null.

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

Syntax

BinaryFormat.Null(binary as binary) as any

Parameters

NameTypeRequiredDescription
binarybinaryYesThe binary data (no bytes are consumed).

Return Value

functionA binary format function that reads zero bytes and returns null.

Remarks

BinaryFormat.Null is a binary format specifier that reads zero bytes from the binary stream and returns null. It does not advance the read position.

This is useful as a placeholder in composite binary formats like BinaryFormat.Record or BinaryFormat.Choice where a field needs to exist in the result but does not correspond to any actual data in the binary stream. It can also be used in BinaryFormat.Group to skip or ignore certain tagged items.

Examples

Example 1: Use BinaryFormat.Null in a record

let
    binaryData = #binary({0x01, 0x02}),
    format = BinaryFormat.Record([
        First = BinaryFormat.Byte,
        Padding = BinaryFormat.Null,
        Second = BinaryFormat.Byte
    ])
in
    format(binaryData)

Compatibility

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