Close menu

Boolean Data

Crumpled balls of colored paper on a reflective surface, and a yellow ball hovering in mid-air with yellow chalk drawings surrounding it to look like a lightbulb turned on.

Also known as True/False, Yes/No, On/Off, Active/Inactive, Enabled/Disabled, and many others. At the heart of it all, boolean is simply a binary of 1 or 0. The boolean data type is:

true or false value. Can be used directly in IfFilter and other functions without a comparison.

Microsoft Learn Documentation

But what does that actually mean, and how is it used in Power Apps?

The boolean value is powerful, extremely useful, and simple to understand, however, the simplicity can quickly become over-complicated when compounded. Several properties within Power Apps require a boolean value including: VisibleResetAutoHeightUnderlineItalic, and Strikethrough. In all cases, these properties simply want to know: true or false; am I on or am I off?

A few things to know for Power Apps

  1. Values are case sensitive, meaning the only accepted terms are true and false. Using True, TRUE, False, FALSE, or any other variation of upper- and/or lower-case letters will result in an error.
  2. Logical operators and several of the Power Fx functions result in boolean values. Use this as an advantage to dynamically update the look and feel of an app as it is used.
    • Logical Operators
      • && (And)
      • || (Or)
      • ! (Not), <> (Not equal)
      • < (Less than), <= (Less than or equal to)
      • > (Greater than), >= (Greater than or equal)
      • in and exactin
    • Example of Power Fx Functions resulting in boolean values
      • IsBlank, IsBlankOrError
      • IsEmpty
      • StartsWith, EndsWith
  3. Boolean values can be stored differently between data sources. Ultimately, when the information flows into and out of Power Apps, unless it is stored as a different data type in the source, Power Apps will make the conversion.

Boolean Quick Tips

  • There may be times when a boolean value is required, but the use of true or false results in an error. In those cases, I have definitely used 1 = 1 for true and 0 = 1 for false, which has cleared the error.
  • There is technically a third, hidden boolean value equal to Blank or Null. This can be useful for forms and determining if a response was provided. I have used this value to help with setting data types in my apps. In the App.OnStart property, I have indicated blank/null values are acceptable within a dataset by declaring the following statements:
    Boolean If( 1 = 0, true )
    Text If( 1 = 0, “” )
    Number If( 1 = 0, 0 )
    Record If( 1 = 0, {Id: 0, Value: “”} )
    Table If( 1 = 0, Table( {Id: 0, Value: “”} ) )
  • If a value is not provided in the final else statement of the If function, then Power Apps will return the value as blank/null. This is the equivalent to using Blank().










0 0 votes
Post Rating
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x