Binary.ToList
BinaryConverts a binary value into a list of byte numbers (0-255).
Syntax
Binary.ToList(binary as binary) as listParameters
| Name | Type | Required | Description |
|---|---|---|---|
binary | binary | Yes | The binary value to convert to a list of byte values. |
Return Value
list — A list of numbers (each 0 to 255) representing the individual bytes of the binary value.
Remarks
Binary.ToList converts a binary value into a list of numbers, where each number represents a single byte (0 to 255). This is the inverse of Binary.FromList.
This function is useful for inspecting binary data at the byte level, performing byte-level transformations, or debugging binary content.
Examples
Example 1: Convert a binary value to a list of bytes
let
Source = Binary.From("Hi"),
Bytes = Binary.ToList(Source)
in
BytesApplied Steps
Converts the binary value to a list of byte values: {72, 105}, corresponding to the ASCII codes for 'H' and 'i'.
Value | |
|---|---|
| 1 | {72, 105} |
Example 2: Round-trip from list to binary and back
let
Original = {0, 127, 255},
AsBinary = Binary.FromList(Original),
BackToList = Binary.ToList(AsBinary)
in
BackToListApplied Steps
Converts the binary back to a list of byte values, confirming the round-trip produces {0, 127, 255}.
Value | |
|---|---|
| 1 | {0, 127, 255} |
Compatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks