DEFAULT

Returns default value in case the original value is empty

Description

If the given value is non-empty (as per the definitions in the EMPTY function), returns the given value, otherwise return the given default.

Function signature

DEFAULT(value: , default: ) => Boolean|Number|Object|Array

Parameter

Description

Value

Value to check

Default

Default value

Examples

Formula

Return value

DEFAULT(true, 1)

true

DEFAULT(null, 1)

1

DEFAULT({ a: 1 }, 1)

{"a":1}

DEFAULT([], 1)

[]