as title, i want express if isnull(backuppricingaudit) then don't do anything with it. Without foreach loop, how to express it?
Discussion posts and replies are publicly visible
Hi immortalvirgil,
I'm assuming that backuppricingaudit is a local variable you have created in an interface or expression rule?
If so, one approach you can use is a combination of a!flatten() with isnull() and length().
By definition a!flatten() converts an array that contains other arrays into an array of single items, preserving the types and relative order of all the nested array items.
e.g. The following code will return true
a!localVariables( local!backuppricingaudit: { {null}, {null} }, or( isnull(a!flatten(local!backuppricingaudit)), length(a!flatten(local!backuppricingaudit)) < 1 ) )
length(a!flatten())=0 works
This is correct, but I highly recommend that you use both the isnull and length checks. Even if this specific scenario works with checking if length is 0, there are many other scenarios that are triggered if the value is null. Personally the first rule I build (or import as a common object) is a rule for "isNullOrEmpty" that checks both if the value is null OR empty. Spoiler alert - there is also an out-of-the-box function that does both these checks coming in 21.4
isNullorempty will flatten multiple items with null value in it right?