Skip to main content
Version: Streamsheets 3.0

JSON Range

Streamsheets use the JSON format to transfer and process data. Creating a JSON-Range in a Streamsheet helps you easily structure your data keys in a hierarchical order. This is needed when you are about to transmit data and need it structured in a certain way. In a Streamsheet, this is possible by writing all your key-value pairs below each other. After (or before) you are done, select all cells and right-click. Choose “Define JSON-Range” at the bottom of the menu.

By default, a created JSON Range is always flat. You can start structuring your data using TAB and Shift+TAB to change the hierarchy of a key-value pair.

You can now use a JSON Range in functions to send structured data. Use, e.g., MQTT.PUBLISH() and use the created JSON Range as your payload. Also, check out the function JSON(). With it, you can create a JSON and also display it as a string.

A JSON Range is automatically created, if you copy and paste a valid JSON into a cell. Copy the following to try it out.

{
"InterestingData1":12,
"InterestingData2":15,
"MoreData":{
"DatafromA":17,
"DatafromB":1234,
"DatafromC":625,
"DatafromD":892
}
}

Use the JSON Range not only to display hierarchical order. Many times the JSON format is needed to interact with APIs or other endpoints. The JSON Range allows you to create data in a visual pleasing way and still being able to send JSON data. The same visual representation as in the JSON Range is also used in the Inbox for incoming messages.