JSON Map
Overview
JSON Map step can be used for mapping certain values to the doc nodes - i.e. for attaching workspace variables to doc context for easier use in flow steps.
A regEx expression can be used on the value source to extract parts from it (e.g. matching the token part from authorization header).
Configuration
- Parallel Execution
parallel- By dafault the value isfalseand the map operation will execute in sequential order. Set the value totrueif you want to execute map operation in parallel. Parallel execution has better performance but make sure that all map operations are independent. Below is an example of map operations:
Map operations
[
{
"regex": null,
"targetPath": "username",
"value": "{{$env.username}}"
},
{
"regex": null,
"targetPath": "password",
"value": "{{$env.password}}"
}
]
note
Below is not recomended example because the second map operation needs the value set by first.
Map operations
[
{
"regex": null,
"targetPath": "x",
"value": "{{'1'}}"
},
{
"regex": null,
"targetPath": "y",
"value": "{{x+2}}"
}
]
Multiple mappings can be done within the step.
- Mappings
source path- path to hte data ondoccontextvalue- static content to be placed in target path (use one of sourcePath, sourcePartialPath or value)Source partial path- if the partial path is unique, set the partial path to the source datatarget path- thedocnode on which to place the extracted valueappend- if checked this will create an array of all the values that are added to the targetdelete- if checked will delete the sourcedocnodeas string- if checked will convert the source data to string
Examples
note
In this example we have stored the password as workspace variable named password in ACE settings and we will be extracting it from that variable to attach to doc node.
Step Configuration
{
"stepType": "map",
"color": "rgb(245,210,211)",
"displayName": "JSON Map",
"isSelected": true,
"config": {
"maps": [
{
"regex": null,
"targetPath": "password",
"value": "{{$env.password}}"
}
]
}
}
Result
{
"doc": {
"password": "1111"
},
"errors": []
}
JSON Map Flow Example
{
"name": "exampleJsonMap",
"flow": {
"name": "exampleJsonMap",
"description": "",
"steps": [
{
"stepType": "map",
"color": "rgb(245,210,211)",
"displayName": "JSON Map",
"isSelected": true,
"config": {
"maps": [
{
"regex": null,
"targetPath": "password",
"value": "{{$env.password}}"
}
]
}
}
]
},
"inputSchema": {},
"createDate": "2021-10-10T17:43:04.154Z",
"id": 1633887784252
}