SetIfEmpty

Checks an object for an empty value and returns a pre-set default value.

javascript · Filters And Transformers

Details

IDSetIfEmpty
Languagejavascript
From Version5.0.0
Tagstransformer general entirelist

README

Checks an object for an empty value and returns a pre-set default value.

Script Data


Name Description
Script Type javascript
Tags transformer, general, entirelist
Cortex XSOAR Version 5.0.0

Inputs


Argument Name Description
value The object value to check, if empty.
defaultValue The new value to return if the original value was empty.
applyIfEmpty If set to true, empty strings, arrays and dictionaries and the strings “None” and “Null” are considered empty entities and the default value is returned.

Outputs


There are no outputs for this script.

args:
- description: The object value to check, if empty.
  name: value
- description: The new value to return if the original value was empty.
  name: defaultValue
- auto: PREDEFINED
  default: true
  defaultValue: 'true'
  description: If set to true, empty strings, arrays and dictionaries and the strings "None" and "Null" are considered empty entities and the default value is returned.
  name: applyIfEmpty
  predefined:
  - 'true'
  - 'false'
comment: Checks an object for an empty value and returns a pre-set default value.
commonfields:
  id: SetIfEmpty
  version: -1
enabled: true
name: SetIfEmpty
script: '-'
tags:
- transformer
- general
- entirelist
timeout: '0'
type: javascript
fromversion: 5.0.0
isllm: false
tests:
- SetIfEmpty_Test