cancel
Showing results for
Did you mean:

## Problem with checkbox.value = boolean

Hi

I'm facing a very strange issue while comparing Checkbox.Value = bool.

I'm using the below code inside a Textbox.Visible:

If(chkIsAff.Value = false, true, false)

The problem is that it is returning false.

See checkbox.value has false value:

And logically false = false

Now the problem, when I verify if checkbox.value = false its returns false instead of true:

What I'm doing is converting value to string to solve my issue

1 ACCEPTED SOLUTION

Accepted Solutions
Super User

Using If statements on a Boolean value to then return a Boolean value is redundant.

If(true, true, false) is redundant because true is already true.

Change your formula to chkIsAff.Value ONLY.   If you want the inverse of that, then change to !chkIsAff.Value

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
3 REPLIES 3
Super User

Using If statements on a Boolean value to then return a Boolean value is redundant.

If(true, true, false) is redundant because true is already true.

Change your formula to chkIsAff.Value ONLY.   If you want the inverse of that, then change to !chkIsAff.Value

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

agree it's correct and also solved. but I have used the other before and worked. Even redundant was expected to work

Super User

The formula editor gets confused on it and show incorrect value.  I've seen that many times and don't rely on it quite like I would want.

Basic thing though is, if you are trying to set any property that needs true or false...skip the If statement as it's just extra typing.  And, in some cases the formula editor will behave properly.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Announcements

#### Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

#### Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

#### European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

#### Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (4,078)