Convert Dict Keys to Ports
This node expands a dictionary (object) into individual output ports.
The Convert Dict Keys to Ports node dynamically creates outputs based on the keys of an input object.
The Convert Dict Keys to Ports node takes a JSON object (Dictionary) as input. When the Do signal is triggered, it analyzes the object's keys and automatically generates a corresponding output port for each key. This is useful for unpacking dynamic API responses or configuration objects.
Data
| Data | Description |
|---|
| Dict | The input object/dictionary. |
Control
| Signal | Description |
|---|
| Do | Triggers the conversion. The node reads the Dict, updates its ports, and pushes values to the outputs. |
Outputs
Control
| Signal | Description |
|---|
| Done | Triggered when the operation is complete. |
Dynamic Outputs
| Data | Description |
|---|
| * | One output port for each key found in the input Dict. The name matches the key (formatted for display). |
Usage
Unpacking API Data
- REST node returns a complex JSON object (e.g.,
{ "weather": "sunny", "temp": 25 }).
- Connect the JSON to Dict.
- Trigger Do.
- The node will update to show outputs "Weather" and "Temp".
- Connect these to Text nodes.
Detailed Behavior
- Dynamic Ports: The ports persist even if the input data is removed, until a new Dict with different keys is processed.
- Type Inference: It attempts to guess the type of each output (String, Number, Boolean) based on the value.
Troubleshooting
- Ports Not Updating: You must trigger Do for the node to analyze the input and update its ports. Just connecting the wire is not enough.