Skip to main content

If-Then-Else

This Script is part of the Filters And Transformers Pack.#

A transformer for simple if-then-else logic.

Script Data#


NameDescription
Script Typejavascript
Tagstransformer, general
Cortex XSOAR Version5.0.0

Inputs#


Argument NameDescription
valueThe value to evaluate
equals(Deprecated) If value equals this
thenReturn this value if 'condition' is true
elseReturn this value if 'condition' is false
conditionThe condition expression to evaluate such as lhs==rhs or lhs!=rhs. Will evaluate as value==rhs if left empty for backward compatibility.
lhsThe value to compare in the condition (left hand side)
rhsThe value to compare in the condition (right hand side)
optionsOption flags (comma separated list): available options are `case_insensitive`, `regex_dot_all`, `regex_multiline`, `regex_full_match`, `input_data_type:then=<type>`, `input_data_type:else=<type>`, `input_data_type:lhs=<type>` and `input_data_type:rhs=<type>`. Choose `value`, `json` or `raw` for <type>.
lhsBThe value to compare in the second condition (left hand side)
rhsBThe value to compare in the second condition (right hand side)
conditionBThe second condition expression to evaluate such as lhsB==rhsB or lhsB!=rhsB. Will evaluate as value==rhsB if left empty for backward compatibility.
conditionInBetweenThe condition to put between the first condition (lhs and rhs) and the second condition (lhsB and rhsB)
optionsBOption flags (comma separated list): available options are `case_insensitive`, `regex_dot_all`, `regex_multiline`, `regex_full_match`, `input_data_type:then=<type>`, `input_data_type:else=<type>`, `input_data_type:lhs=<type>` and `input_data_type:rhs=<type>`. Choose `value`, `json` or `raw` for <type>.

Outputs#


There are no outputs for this script.