Skip to main content
Version: ACE 5

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 is false and the map operation will execute in sequential order. Set the value to true if 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 on doc context
    • value - 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 data
    • target path - the doc node on which to place the extracted value
    • append - if checked this will create an array of all the values that are added to the target
    • delete - if checked will delete the source doc node
    • as 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
config:
maps:
- regex: null
targetPath: password
value: "{{$env.password}}"
name: JSON Map
description: ""
condition: ""

Result
{
"doc": {
"password": "1111"
},
"errors": []
}
JSON Map Flow Example
    tags: []
steps:
- stepType: map
config:
maps:
- regex: null
targetPath: password
value: "{{$env.password}}"
name: JSON Map
description: ""
condition: ""
sampleData: {}