Skip to main content
Version: Streamsheets 2.5


This function can be used to efficiently add array items to a message. Creates a JSON array entry using the given keys and values. If the range has one row or column, one array entry for each cell is created. If there are two columns or rows, a nested array (array containing a subarray) will be created. Note that if both nest and flat parameters are set to true one can use range instead.


=ARRAY(Range, [Nest], [Flat])


RangeSource Range to retrieve data from
Nest (optional)Direction on how to nest items, if range has more than one row or column. FALSE to nest by column and TRUE to nest by row. Default is TRUE.
Flat (optional)If this Argument is supplied (any value works!) the returned Array is always nested, even if only one row or column is specified. If Argument is missing than the returned array is only nested if there are more than one row or column.


Comma separated list of array items.


=WRITE(OUTBOXDATA("Message", "NewItem"), ARRAY(A2:B5, FALSE), "Array") with the following cell content: [object Object] [object Object]
Appending an array to a message.
Since Nest is set to FALSE, the array items are created by columns
leading to two array entries. The two entries contain
the elements from the rows top to bottom.
The message content will look as follows
=WRITE(OUTBOXDATA("Message","NewItem"),[object Object] ARRAY(A2:A5,FALSE),"Array") =WRITE(OUTBOXDATA("Message","NewItem2"),[object Object] ARRAY(B2:B5,FALSE,TRUE),"Array")[object Object] [object Object]
Example usage of the nested parameter.

If you want to create an Outbox array step by step, you can use "-1" as last outbox data path to automatically add a new array element to the existing outbox message. =WRITE(OUTBOXDATA("Message";"data";-1);JSON(B1:C5);)