Map workflow operator
Purpose
The Map operator produces its output by using only selected parts of its input.
The correspondence between input parts and corresponding output parts is called mapping, hence the name of the operator.
The Map operator is particularly useful downstream of a Join block to "clean up" the composite output of that operator or to create a customized version of it, as the final output of the workflow or as the input to further blocks. For this reason, it can be considered a post-processor.
Defining the map
The map between input and output is defined by editing the block in the workflow editor.
To create a mapping:
- Edit the block.
- In the Type specific tab of the block properties window, under Mapping, select the plus key. Two new fields appear below, the output key on the left and a drop-down menu on the right.
- Enter the name of the output key in the left field.
- Select the corresponding input property from the drop-down menu.
In the image below you can see an example of mapping.
The drop down menu shows "dotted" entries, for example
block name.document.categories
together with the names of their "parent" blocks.By choosing a block name instead of one of its "dotted" properties, the corresponding portion of the output of the Map block is an object whose value is the entire portion of the input produced by the chosen input block.
If all or part of the output comes from an ML model and has not been filtered along the path, only the ML output is available despite the possibility of mapping also for the symbolic part.
In this case, trying to map a symbolic key returns a null
value in output.
Select the trash bin button to remove a single mapping.
Output
The output of a Map block is a JSON object containing the results of the input mapping. Its structure is as follows:
{
first key: mapped input property
second key: mapped input property
third key: mapped input property
...
}
If a mapped input property is missing at run time, the corresponding output object will be set to null
.
Block properties
A Map operator block has these properties:
- The unique block ID (read only)
- Block name