Split JSON Array

From Visuino
Jump to navigation Jump to search

File:TArduinoSplitJSONArray.png

Summary

Use this component to extract and route elements from a JSON array into typed output pins.

Description

The **Split JSON Array** component reads a JSON-formatted text array input and parses it into separate output channels based on the configured element types (e.g., Text, Boolean, Integer, 64-bit Integer, Unsigned, Analog, Object, Array, or any JSON). - When **Only Modified** is enabled, only elements 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 an array value cannot be processed, the **Error** pin emits a clock signal to allow error handling in the data flow. Additional **Unprocessed** pins—**Index** (Integer) and **Value** (Text)—provide insights into the position and content of items that could not be parsed.

This functionality mirrors Visuino's "Split Structure" and "Split JSON" components and is commonly used in tutorials demonstrating structured JSON handling.:contentReference[oaicite:0]{index=0}

Diagram:

Categories

Properties

  • Enabled – Toggle the component on or off.
  • Elements – Specifies which types of elements to parse from the JSON array: “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 elements whose values have changed since the previous trigger.

Pins

  • In – JSON array input (text).
  • Unprocessed – **Index (Integer)**: indicates the array index 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 array element.