Binary.FromList
Bytes put together from whole numbers of 0 to 255, each number one byte, in the list's order.
Group: Binary and lines. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
Binary.FromList(list as list) as binary
| Parameter | Type | Description |
|---|---|---|
list | list | Whole numbers from 0 to 255, in order. |
Returns
binary. The bytes; an empty binary for an empty list.
Remarks
- A number outside 0 to 255, or one with a fraction, is an error when the bytes are used.
#binarydoes the same with a list written in the query.
Compared with Power Query
Known difference in OpenBI Studio 0.3.79, found while this page was written and run on its engine:
(try Binary.FromList({79, 256}))[HasError]: Power Query gives false: it reads the list only when the bytes are used, and the error comes then. OpenBI reads the list at once, sotrycatches the error here and gives true; the message is the same.
Examples
Bytes read as text
Text.FromBinary(Binary.FromList({79, 115, 108, 111}))
"Oslo"
Not a byte
Binary.Length(Binary.FromList({79, 256}))
Result: an error.
[Reason = "Expression.Error", Message = "The number is out of range of a byte value.", Detail = 256]