Skip to main content

Data Mapper Component

Map input values to output values using a specified mapping

Component key: data-mapper

Description#

The data mapper component allows you to apply a map to a value or list of values. This is handy if you have a list of items, and would like to categorize each item.

For example, if you have a list of input that reads:

["apple", "orange", "carrot"]

and a map that reads:

{  "apple": "fruit",  "blueberry": "fruit",  "carrot": "vegetable",  "green bean": "vegetable",  "orange": "fruit"}

then a value list mapper action would output ["fruit", "fruit", "vegetable"].

Actions#

Value List Mapper#

Map list of inputs to list of outputs using a map object | key: valueListMapper

InputNotesExample
Input
Input Value List
data
/ Required
Notes
This is a list of keys that will be mapped to values using the Value Map.
Example
["apple", "orange", "carrot"]
Input
Value Map
code
/ Required
Notes
A key/value map that matches inputs by key and returns their associated value(s).
Example
{  "apple": "fruit",  "blueberry": "fruit",  "carrot": "vegetable",  "green bean": "vegetable",  "orange": "fruit"}

Output Example Payload#

{  "data": [    "fruit, fruit, vegetable"  ]}

Value Mapper#

Map an input to an output using a map object | key: valueMapper

InputNotesExample
Input
Input Value
data
/ Required
Notes
This is the key that will be used to find a value from the Value Map
Example
apple
Input
Value Map
code
/ Required
Notes
A key/value map that matches inputs by key and returns their associated value(s).
Example
{  "apple": "fruit",  "blueberry": "fruit",  "carrot": "vegetable",  "green bean": "vegetable",  "orange": "fruit"}

Output Example Payload#

{  "data": "fruit"}