OpenBI Docs Buy

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
ParameterTypeDescription
listlistWhole 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.
  • #binary does 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, so try catches 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]

Binary.ToList, #binary, Text.FromBinary.

Last updated · OpenBI Studio 0.3.79