IFBLANK function

IFBLANK(Value, ValueIfBlank) IFBLANK(Value; ValueIfBlank)

Value

The value to return if it is not blank.

ValueIfBlank

The value to return if the value parameter is blank.

Returns

The first parameter if it is not a "not available" error and the second parameter otherwise.

Returns a value unchanged if it is not blank and a different value otherwise. IFBLANK(Field1, 4)IFBLANK(Field1; 4) returns the value of Field1 if it is not blank, and 4 otherwise.

The formula above is equivalent to this formula, but IFBLANK does not require the value to be repeated:

IF(ISDEFINED(Field1), Field1, 4)IF(ISDEFINED(Field1); Field1; 4)

This function is specific to Calcapp.

IFBLANK and arrays

Invoking IFBLANK with an array as its first parameter applies it to the array as a whole, not to its constituent elements.

This formula returns the array { Field1 }{ Field1 } if the IncludedFields property returns a blank value:

IFBLANK(EmailReportButton1.IncludedFields, { Field1 })IFBLANK(EmailReportButton1,IncludedFields; { Field1 })

Use MAP to invoke IFBLANK once for every array element instead. This formula returns the array { 1, 2, -1, 4 }{ 1; 2; -1; 4 }:

MAP({ 1, 2, BLANK(), 4 }, IFBLANK(Element, -1))MAP({ 1; 2; BLANK(); 4 }; IFBLANK(Element; -1))

Above, IFBLANK is invoked once for each array element. When it encounters the third array element, which is blank, it returns -1 instead of the array element. MAP incorporates all return values from IFBLANK into the result array.

Examples

IFBLANK(Field1, 4)IFBLANK(Field1; 4)

Returns the value of Field1 if it is not blank, and 4 otherwise.

IFBLANK(EmailReportButton1.IncludedFields, { Field1 })IFBLANK(EmailReportButton1,IncludedFields; { Field1 })

Returns the array { Field1 }{ Field1 } if the IncludedFields property returns a blank value.

MAP({ 1, 2, BLANK(), 4 }, IFBLANK(Element, -1))MAP({ 1; 2; BLANK(); 4 }; IFBLANK(Element; -1))

Returns the array { 1, 2, -1, 4 }{ 1; 2; -1; 4 }. IFBLANK is invoked once for each array element and returns all array elements unchanged, except for the third array element. That element is blank, and causes IFBLANK to return -1. MAP incorporates all return values from IFBLANK into the result array.