Appearance
Create Mapping
Overview
The Create Mapping node dynamically builds a dictionary by pairing elements from two parallel lists. It combines a list of keys with a list of values to create a single mapping object.
Use Create Mapping when:
- You want to merge data from two different lists into a searchable dictionary.
💡 Tip
Ensure both the key and value lists have the same number of elements to maintain correct associations.
Inputs
| Name | Type | Description |
|---|---|---|
| key | list | The list of keys to be used in the mapping. |
| value | list | The list of values corresponding to the keys. |
Outputs
| Name | Type | Description |
|---|---|---|
| output | mapping | The resulting dictionary created from the input lists. |
Parameters
This node does not have any configuration parameters.
Example
Merging Sensor Names and Readings
A flow receives a list of sensor names ["temp", "humidity"] and a list of readings from external inputs [22.5, 60.0].
Configuration:
- No parameters.
Result: The node outputs a mapping: {"temp": 22.5, "humidity": 60.0}. This dictionary can then be queried by key name.
Related links
Reference:
- Custom Mapping — create a static mapping via configuration
- Get Value from Mapping — retrieve a value from a mapping using a key