Widgets/Transformer
Combine Array Widget
Combine Array Widget
A "Transformer" type widget. Combine Array Widget collects values from multiple input ports to combine them into a single array when triggered. It can handle any individual piece of data like:
- Numbers (e.g.,
42,3.14) - Text strings (e.g.,
"Hello","World") - Boolean values (
true/false) - Objects (e.g.,
{"name": "Kemu", "age": 1}) - Arrays that will be concatenated (e.g.,
[1,2]+[3,4]=[1,2,3,4])
Each single value becomes an individual element (e.g., 42 becomes [42]), while JSON objects are preserved as single elements (e.g., {"name": "Kemu"} becomes [{"name": "Kemu"}]). The widget supports mixed data types in the resulting array.
Inputs
- input1 to input20 (DataType: Anything) Input ports that can receive either arrays or single values of any type (numbers, strings, booleans, objects). The number of ports is configurable (up to 20 inputs). Values from these ports are collected and stored internally until triggered.
- clear (DataType: Anything) Clears all internally stored values without producing an output. If the properties were auto-filled, they will also be cleared.
- trigger (DataType: Anything) When this port receives any value, it causes the widget to combine all stored values into a single array and output it. After outputting, the internal storage is cleared.
Outputs
- output (DataType: Array) Outputs the combined array when triggered. The array preserves the order in which values were received and maintains the structure of complex objects.
- totalItems (DataType: Number) Outputs the current total number of items stored internally. This value updates each time a new value is added or when the storage is cleared.
Custom Settings
- Total Inputs — Configure the number of input ports (1-20) available for collecting values.

Examples
Creating an Array from Single Values
This example shows how to create an array by combining different types of single values:
Drag the example onto the workspace to explore and experiment!
In this example:
-
The Button widget starts a sequence that:
- First sends three values to the Combine Array widget:
- A number (
42) from a Value widget - A string (
"hello") from a Text widget - An object (
{foo: "bar"}) from an Object widget
- A number (
- Then triggers the Combine Array widget to combine them
- First sends three values to the Combine Array widget:
-
The Combine Array widget:
- Collects each value as it arrives
- Combines them into a single array when triggered
- Maintains the order and type of each value
- Outputs the combined array and updates the total items count
-
A Display widget connected to the totalItems output:
- Shows the current number of items (
3) stored in the Combine Array widget - Updates each time a new value is added or when the storage is cleared
- Shows the current number of items (
-
The Combine Array
outputport is clicked and the Port Inspector displays the Combined Array
Combining Arrays
This example demonstrates combining multiple arrays into a single array:
Drag the example onto the workspace to explore and experiment!
In this example:
-
Two arrays with different data types are provided as inputs in Text widgets:
- First Text widget contains the string
"[1, 2, 3]"(numbers array) - Second Text widget contains the string
"["a", "b", "c"]"(strings array)
- First Text widget contains the string
-
The Button widget sends an event to the Sequence widget
-
The Sequence widget executes three actions in order:
- First: triggers the Text widget (containing
[1, 2, 3]) which sends its string content to a Text to Object widget - Second: triggers the Text widget (containing
["a", "b", "c"]) which sends its string content to a Text to Object widget - Third: triggers the Combine Array widget
- First: triggers the Text widget (containing
-
Each Text to Object widget:
- Converts the string to an actual array object
- Sends the array to the Combine Array widget
-
The Combine Array widget:
- Receives the number array
[1, 2, 3]throughinput1 - Receives the string array
["a", "b", "c"]throughinput2 - When triggered by the Sequence widget, combines both arrays into a single array
- Outputs the total count (
6) through thetotalItemsport
- Receives the number array
-
The Display widget receives the total count and shows
6(total elements in the combined array) -
After triggering, the internal storage is cleared, ready for new arrays
📌 Additional Notes
- The widget maintains the order of values as they are received
- The internal storage is cleared after triggering or using the clear port
- When combining objects, their structure and data types are preserved
- The widget automatically detects and preserves the shape of JSON objects
- Single values (numbers, strings, booleans, objects) become individual elements in the final array
- Arrays are concatenated with their elements spread into the final array
- The totalItems output updates in real-time as values are added or cleared
Glossary
-
JSON
JavaScript Object Notation, a lightweight data interchange format that represents data as key-value pairs and arrays.