Skip to main content
Version: Streamsheets 3.0

JSON

A Streamsheet has the possibility to process, generate and accumulate data. Before sending this data, the cells from a data range have to be structured, in order for an App to interpret them correctly. JSON() is paring two columns together to a key and value pair using the JSON Syntax. Alternatively it is possible to specify a text which will be parsed to JSON or use one of the various INBOX/OUTBOX functions to reference an element from a message stored in inbox or outbox respectively. The optional second parameter can be used to convert the resulting JSON object to a textual representation. This function is mostly used within publish functions like: MQTTPUBLISH. The JSON structure supports quotes "". eg. {"Key":"value"}

Syntax

=JSON(DataRangeOrTextOrInboxOutboxFunction, [ResultAsText])

Arguments

NameTypeDescription
DataRangeOrTextOrInboxOutboxFunctionA data range over at least two columns, only interpreting the first and last column into the JSON object. Or a text which will be evaluated to JSON. Or an INBOX/OUTBOX function to reference an element of a message.
ResultAsText (optional)BooleanSet to TRUE to return a textual representation of resulting JSON object.

Default value: FALSE

Return

TypeDescription
JSON{ JSON } as a placeholder for JSON object or a textual representation, if successful.

Examples

AB
1values
2temperature16918
3CO249
4
5{"values":{"temperature":16918,"CO2":49}}
FormulaResultComment
=JSON(A1:B3)
{ JSON }This is the representation of a cell filled with JSON data.
=JSON(A1:B3, TRUE)
{"values":{"temperature":16918,"CO2":49}}The textual representation of resulting JSON data.
=JSON(A5)
{ JSON }This is the representation of a cell filled with JSON data.
=JSON(OUTBOXDATA("MessageId","Customer"))
{ JSON }This is the representation of a cell filled with JSON data. Internally the cell has a JSON object which represents the "Customer" value from specified outbox message.
=FEEDINBOX(JSON(A1:B3),Sheet1!)
JSONIn Streamsheet Sheet1 the Inbox will be filled with the JSON