You are currently reviewing an older revision of this page.

[DRAFT SP-7550 Unexpected behavior with a!isNullOrEmpty

Symptoms

a!isNullOrEmpty() returns false when the value being checked is a list containing only null or "" elements

For example, a!isNullOrEmpty({null}) returns false.

Cause

This is expected behavior as a list with only null or "" elements is not an empty list. Additionally, a!isNullOrEmpty() does not iterate over lists to check for these elements in order to improve performance.

Please see the chart below for more examples of expected behavior regarding a!isNullOrEmpty() and lists:

Input Output
a!isNullOrEmpty({{}, ""}) false
a!isNullOrEmpty(cast(197, "")) false
a!isNullOrEmpty({tostring(null), tointeger(null)}) false
a!isNullOrEmpty({null,null}) false

Action

If a value is a list that may contain only null or "" elements, please consider using length() or a!forEach() to check if it is empty.

Affected Versions

This article applies to all versions of Appian.

Last Reviewed: September 2022