'True' and 'False' Boolean Values in the ReportWriter

Modified on Sat, Dec 2, 2023 at 11:17 AM

The Boolean values of true and false are handled differently on the Filters and Defined Linked Column screens than they are in Expressions.


Boolean Values on the Filters and Defined Linked Columns Screen

On the ReportWriter screens Boolean values are represented by a Y or an N:  True values are represented by Y and false values by N.


For example, to test whether a Boolean field is true you must compare it to Y:


To test whether a Boolean field is false you must compare it to N:


Note that there are no quotes around the N or the Y.


Boolean Values in Expressions

In contrast to the ReportWriter screens, in Expressions, true  is directly represented by the word true and false is directly represented by the word false.


This will print "HAPPY BIRTHDAY" on a student's birthday (if you have added the "birthdayToday" column to your report) and a blank on all other days:

${ row.birthdayToday == true ?  'HAPPY BIRTHDAY' : '' }


Implied Boolean Values

In places where a Boolean value is required, e.g. the 'test' part of Conditional Expression (A ? B : C  <-  in the A part),  if the field is itself a Boolean, you do not need to test against true or false .   The "Boolean" nature of the expression is enough and the == true or == false can be omitted:

${ row.birthdayToday   ?  'HAPPY BIRTHDAY' : '' }


The 'NOT' Operator: !

The 'NOT' operator (!) reverses the value of a Boolean expression.   If row.someBoolean is truethen  !row.someBoolean is false.


The expression below does the exact same thing as the version above - except that the values have been reversed:

${ ! row.birthdayToday   ?  '' : 'HAPPY BIRTHDAY' }

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article