Skip to main content
February 1, 2022
Question

Need to understand the difference between the usage of the rules APN_isEmpty and APN_isBlank

  • February 1, 2022
  • 11 replies
  • 0 views

Hi,

Could someone clarify my doubt about difference between the usage of the rules APN_isEmpty   and APN_isBlank?

It would be good if a simple example is illustrated to make it simple to understand.

Thanks

Faisal

    11 replies

    mikes0011
    Brainy
    February 1, 2022

    Note that these are now largely unnecessary thanks to the new rules a!isNullOrEmpty() and a!isNotNullOrEmpty().

    As far as the two you've named - isBlank() is meant to determine whether a singular value is blank or null, while isEmpty() is meant to determine whether an array is completely empty.  For instance, an array with a single null is not considered empty, but would (iirc) show up as "blank".

    In the past though it was important to use these helper rules because there were some odd corner cases in the primitive rules that would break.  I don't remember many exact examples off the top of my head.  There was no direct way to do isEmpty() but by doing i.e. "length(ri!value) = 0", which itself fails when the value is null (instead of an empty set), so the helper rule handled null-checking.  The new functions I named at the top of this reply handle all that stuff pretty gracefully as far as I can tell.

    andrewh0007
    February 1, 2022

    Fully agree with Mike. The singular values cause less problems but I've certainly had them cause issues in the past. The need for isEmpty() is much more demonstrable, see below:

    Using isnull() on a list of nulls returns false which is generally not the desired outcome.

    But also as Mike points out, the new a!isNullOrEmpty() and a!isNotNullOrEmpty() is the way to go if you're on version 21.4.

    stefanhelzle0001
    Brainy
    February 2, 2022

    isEmpty check whether a value is null or an empty list. isBlank checks for null and an empty string.

    I do not use these expressions and recommend to use the new a!isNullOrEmpty function

    docs.appian.com/.../fnc_informational_isnullorempty.html

    February 2, 2022

    Hi All,

    Really very helpful suggestions and solutions [emoticon:c4563cd7d5574777a71c318021cbbcc8].

    One thing I did not understand. What is "singlePV"

    rule!APN_isBlank(singlePV)

    Returns boolean regarding a singlePV if it's either null or has no characters.

    singlePV (Any Type)

    Could someone clarify please?

    Thanks

    Faisal

    mikes0011
    Brainy
    February 2, 2022
    What is "singlePV"

    I don't see this exact term used anywhere prior in this thread, or even at Stefan's link - can you clarify what you're referring to?  Without any other context I'd guess it's referring to a PV of "single" type, i.e. not an array (aka "multiple"), but that's just a blind guess at this point.