Skip to content

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

NameTypeDescription
mappingmappingThe resulting dictionary created from the configured parameters.

Parameters

ParameterDefaultValid valuesTunable
mapping{}dictionary
key_typestringstring, number, integer
value_typestringstring, 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.

Reference: