cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Wedlib
Advocate II
Advocate II

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:

 

Wedlib_0-1639604776213.png

 

And logically false = false

Wedlib_1-1639604852549.png

 

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

Wedlib_2-1639604959039.png

 

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

Wedlib_3-1639605039277.png

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@Wedlib 

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!

View solution in original post

3 REPLIES 3
RandyHayes
Super User
Super User

@Wedlib 

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!
Wedlib
Advocate II
Advocate II

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

RandyHayes
Super User
Super User

@Wedlib 

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!

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (3,923)