Appearance
Custom Mapping
Overview
The Custom Mapping node creates value mapping based on user configuration. It typically serves as a reference table for other nodes to look up values based on specific keys. While mapping created is based on configuration with no ability to change it from other nodes, parameter is dynamic - enabling use in Tunables where users can update this value while deployment is running.
Use Custom Mapping when:
- You need to define a fixed set of associations, such as error codes to human-readable messages.
- You want to translate internal IDs into display names for UI elements.
💡 Tip
Use this node to keep your logic clean by adding detection metadata in one place.
Outputs
| Name | Type | Description |
|---|---|---|
| mapping | mapping | The resulting dictionary created from the configured parameters. |
Parameters
| Parameter | Default | Valid values | Tunable |
|---|---|---|---|
| mapping | {} | dictionary | ✅ |
| key_type | string | string, number, integer | ❌ |
| value_type | string | string, number, integer, boolean | ❌ |
mapping
Defines the collection of keys and their corresponding values. This parameter is defined in a format of collection with KEY: VALUE pairs. Each key has its own associated value, and multiple keys can have same value. Keys have to be unique within one mapping and both key and value need to match defined types.
Define mapping in following format: {"KEY1": "VALUE1", "KEY2": "VALUE2", "KEYN": "VALUEN"}
WARNING
Ensure that your mapping corresponds to selected types, system does not verify or correct your selection.
key_type
Sets the data type for all keys in the dictionary.
- string treats keys as text.
- number treats keys as numeric values for strict matching.
- integer indicates that numerical value used will be whole number only.
value_type
Sets the data type for all values stored in the dictionary.
- boolean is useful for simple flag associations.
- string is used for descriptive or numeric data.
- number treats values as numeric values for strict matching.
- integer indicates that numerical value used will be whole number only.
Example
Status Code Translation
A flow needs to convert numeric status codes from a sensor into descriptive text.
Configuration:
- mapping:
{"0": "Idle", "1": "Running", "2": "Error"} - key_type:
integer - value_type:
string
Result: The node outputs a mapping that allows other nodes to retrieve "Running" when they query for the key 1.
Related links
Reference:
- Get Value from Mapping — retrieve a value from a mapping using a key
- Create Mapping — build a mapping dynamically from two lists
- Dynamic Selector — select paths based on mapping values