Skip to main content

InvertEveryTwoItems

This Script is part of the Community Common Scripts Pack.#

Supported versions

Available on Cortex XSOAR (versions 6.0.0 and later) and Cortex XSIAM.

This transformer will invert every two items in an array. Example:
["A", "B", "C", "D"] Result: ["B", "A", "D", "C"]

If the total of items in the array is an odd number the last item will be removed Example: ["A", "B", "C", "D", "E"] Result: ["B", "A", "D", "C"]

If the item is not an array the output will be same passed object.

Script Data#


NameDescription
Script Typepython3
Tagstransformer, list

Inputs#


Argument NameDescription
value

Outputs#


There are no outputs for this script.