Skip to main content
Version: ACE 5

Lookup Map

Overview

Lookup map allows attaching/replacing the values of object properties according to predefined values in a predefined lookup array. A good example for this would be when you have an policy type Id and to give it a meaning it is possible using Lookup Map to attach (or replace) the id with more meaningful title.

Example input
 {
"policy": {
"policyTypeId": 23
},
"reference": [
{"policyTypeId": 23, "title": "Car Insurance" }
]
}
Example result
{
"doc": {
"policy": {
"policyTypeId": 23,
"policyType": "Car Insurance"
},
"reference": [
{
"policyTypeId": 23,
"title": "Car Insurance"
}
]
},
"errors": []
}

Here after running the flow we have attached the policyType title from the reference lookup array to the policy to make the returned data more meaningful to consumers of the API.

Configuration

Lookup map definitions

  • Target path - node in the doc context where to place the resolved value.
  • Search By Path - node in the doc, from which to take walue that will be matched against the value in lookup value array
  • Search By Value

Lookup properties

  • Source Path - node in doc context where the lookp array is located
  • Source Lookup - array of lookup values (if Source Path is not provided it is possible to manually provide these values)
  • Key Path - path inside the lookup array item to which the value will be compared against (if this value is equal to Search by path value then the lookup array item will be matched)
  • Value path - path inside the lookup array item from which to take value to place in original object (in Target path configured in Lookup map definitions)

Example

Flow input
{
"policy": {
"policyTypeId": 23
},
"reference": [
{
"policyTypeId": 23,
"title": "Car Insurance"
}
]
}
Step configuration
steps:
- stepType: lookup
config:
maps:
- lookup:
sourcePath: reference
lookupKeyPath: policyTypeId
lookupValuePath: title
targetPath: policy.policyType
searchByPathValue: policy.policyTypeId
name: Lookup Map
description: ""
condition: ""
Example flow
    tags: []
steps:
- stepType: lookup
config:
maps:
- lookup:
sourcePath: reference
lookupKeyPath: policyTypeId
lookupValuePath: title
targetPath: policy.policyType
searchByPathValue: policy.policyTypeId
name: Lookup Map
description: ""
condition: ""
sampleData:
policy:
policyTypeId: 23
reference:
- policyTypeId: 23
title: Car Insurance