Question on dynamically displaying information based on boolean

In a SAIL form, I have a Boolean checkbox that when checked, should display 2 fields and when unchecked should display 2 different fields, but when checked only the first of the 2 fields is shown. I've attached the code for my example. There's a working and a non-working version. The only difference is in the one, I use if(local!bool, {...},{...}), and in the other I use if(isnull(local!bool),{...},{...}). Why would only one of my 2 fields display in the non-working version?

Checkbox problem.txt

OriginalPostID-188454

OriginalPostID-188454

  Discussion posts and replies are publicly visible

Parents
  • @lorib To the best of my knowledge, this is because local!bool is acting as an array variable. An array variable when used in the if() condition (i.e. if(local!bool) as per your example), acts in a different manner. And further this behavior can be studied from various posts by making a search in the forum.

    The reason why the other piece of code (isnull(local!bool)) is working is, isnull(local!bool) is resulting into a single valued boolean result and it's perfect.

    I have attached the modified version of your code and it should resolve your issue.
Reply
  • @lorib To the best of my knowledge, this is because local!bool is acting as an array variable. An array variable when used in the if() condition (i.e. if(local!bool) as per your example), acts in a different manner. And further this behavior can be studied from various posts by making a search in the forum.

    The reason why the other piece of code (isnull(local!bool)) is working is, isnull(local!bool) is resulting into a single valued boolean result and it's perfect.

    I have attached the modified version of your code and it should resolve your issue.
Children
No Data