MakePair
Filters And Transformers Pack.#
This Script is part of theSupported versions
Supported Cortex XSOAR versions: 6.8.0 and later.
This transformer will create a list of dictionary by aggregating elements from two arrays.
The one is given by value
(with array1_key
), another is given by array2
(with array2_key
).
#
Script DataName | Description |
---|---|
Script Type | python3 |
Tags | transformer, general |
Cortex XSOAR Version | 6.8.0 |
#
InputsArgument Name | Description |
---|---|
value | The array1 |
array1_key | The key or path to get values from the array1 (value) |
array2 | The array2 |
array2_key | The key or path to get values from the array2 |
output_name1 | The key name in the output dictionary to which each of element of the array1 are given |
output_name2 | The key name in the output dictionary to which each of element of the array2 are given |
determine_output_length_by | How to deal with different size lists. (Choose from shorter, longer, array1, or array2) |
merge_dict | Specify which array will be merged into when each of element is given in dictionary. (Choose from array1, array2, array1|2, or array2|1) |
#
OutputsThere are no outputs for this script.
#
ExamplesSimply create a list of dictionary by aggregating elements from two arrays.
value:
array1_key:
array2:
array2_key:
output_name1: xxx
output_name2: yyy
determine_output_length_by:
merge_dict:
#
Output:Aggregate each of value from the keys given.
value:
array1_key: key1
array2:
array2_key: key3
output_name1: xxx
output_name2: yyy
determine_output_length_by:
merge_dict:
#
Output:Truncate remaining elements of array2 which is longer than array1.
value:
array1_key: key1
array2:
array2_key: key3
output_name1: xxx
output_name2: yyy
determine_output_length_by: array1
merge_dict:
#
Output:array2 is longer than array1. fill in shorten elements with null.
value:
array1_key: key1
array2:
array2_key: key3
output_name1: xxx
output_name2: yyy
determine_output_length_by: array2
merge_dict:
#
Output:Merge each of dictionary element.
value:
array1_key:
array2:
array2_key:
output_name1: xxx
output_name2: yyy
determine_output_length_by:
merge_dict: array1<2
#
Output:Merge each of element into a dictionary.
value:
array1_key:
array2:
array2_key:
output_name1: xxx
output_name2: yyy
determine_output_length_by:
merge_dict: array1