Zip Lists
Uncontrolled node
Overview
The Zip Lists node combines multiple lists into a single list of objects by pairing elements at corresponding indices. It creates a new list where each element is an object containing values from each input list, keyed by the input socket names.
This is useful for transforming parallel lists (e.g., separate lists of names, ages, and cities) into a single structured list of records (e.g., [{name: "Alice", age: 30, city: "NYC"}, ...]).
Dynamic Inputs
This node uses dynamic inputs based on the Input Names property. Enter a comma-separated list of names (e.g., firstName,lastName,email) to create corresponding input sockets. Each socket accepts a list, and the node will zip these lists together.
The names you provide in the Input Names field become both the input socket labels and the keys in the output objects. Use descriptive names without spaces for best results.
Inputs
| Input | Type | Description | Default |
|---|---|---|---|
| Input Names | Text | Comma-separated list of names that define the dynamic inputs to create (e.g., name,age,city). Changing this value adds or removes input sockets dynamically. | - |
| [Dynamic] | Data | One input socket is created for each name specified in Input Names. Accepts a list or single value. | - |
Outputs
| Output | Type | Description |
|---|---|---|
| Output | Data | A list of objects where each object contains keys named after the input sockets, with values taken from the corresponding positions in the input lists. |
Runtime Behavior
- Uncontrolled: This node runs automatically whenever its inputs change; it does not require an event trigger.
- Array Conversion: If an input receives a non-array value, it is automatically converted to a single-element array.
- Length Handling: If input lists have different lengths, the node uses the length of the longest list. Shorter lists repeat their last element to fill remaining positions (e.g., if list A has 3 items and list B has 2, the third object uses the second item of list B for both the second and third positions).
Example
Input Names property: product,quantity,price
Input values:
product:["Apple", "Banana", "Cherry"]quantity:[10, 5]price:[0.5, 0.3, 1.2]
Output:
[
{"product": "Apple", "quantity": 10, "price": 0.5},
{"product": "Banana", "quantity": 5, "price": 0.3},
{"product": "Cherry", "quantity": 5, "price": 1.2}
]
Note that the quantity list only had 2 items, so the last value (5) was repeated for the third object.