Split JSON Object
File:TArduinoSplitJSONObject.png
Summary
Use this component to extract and route fields from a JSON object into typed output pins.
Description
The **Split JSON Object** component parses a JSON-formatted text input and extracts its fields into separate output channels based on the configured element types: - **Text/String Element** - **Digital/Boolean Element** - **Integer Element** - **64-bit Integer Element** - **Unsigned Element** - **64-bit Unsigned Element** - **Analog Element** - **Object Element** - **Array Element** - **Any JSON**
When **Only Modified** is enabled, only fields whose values have changed since the last output are emitted, reducing redundancy. The **Enabled** property controls whether the splitting logic is active; when disabled, the entire input is passed through untouched.
If parsing fails or a field cannot be processed, the **Error** pin emits a clock signal to allow error handling in the data flow. The **Unprocessed** pins—**Name** (Text) and **Value** (Text)—provide insights into the field name and content of items that could not be parsed.
This component is particularly useful for handling structured JSON data, such as API responses, and routing specific fields to different parts of your application.
Diagram:
Categories
Category Text - Text components category
Properties
- Enabled – Toggle the component on or off.
- Elements – Specifies which types of elements to parse from the JSON object: “Text/String Element”, “Digital/Boolean Element”, “Integer Element”, “64-bit Integer Element”, “Unsigned Element”, “64-bit Unsigned Element”, “Analog Element”, “Object Element”, “Array Element”, or “Any JSON”.
- Only Modified – Only outputs fields whose values have changed since the previous trigger.
Pins
- In – JSON object input (text).
- Unprocessed – **Name (Text)**: indicates the field name of the last unprocessed element; **Value (Text)**: provides the raw content of that element.
- Error – Emits a clock signal when parsing fails.
- Output pins per configured **Elements**: provide typed outputs corresponding to each field.