cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
powerapps890
Post Prodigy
Post Prodigy

Disable checkbox depending on text label

This is what I have for my visible for the checkbox in the gallery If(!CR_1.Text = "95 Blocked/On-Hold" || Self.Value,true, false). If the backlog status is 95 blocked I want to disable the checkbox. Right now, it disables all the ones that are not checked. CR_1.Text is the label that holds the backlog status. Capture.PNG

1 ACCEPTED SOLUTION

Accepted Solutions

@powerapps890 

Please change your formula to this:

!(CR1.Text = "95 Blocked/On-Hold") || Self.Value

_____________________________________________________________________________________
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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

5 REPLIES 5
RandyHayes
Super User III
Super User III

@powerapps890 

 

Change your formula to the following:

!(CR1.Text = "95 Blocked/On-Hold") || Self.Value

 

That will give you what you want.  You might notice that you have a blue line under the equal sign.  That is because the Not operator is doing a Not on the CR_1.Text and then comparing - that is boolean to text...not valid.  If you put the parens around the comparison, it will work.

And, BTW, you don't need to do the If and true and false...it will evaluate to true or false anyway.

 

I hope this is helpful for you.

 

EDIT: Forgot the closing paren in my original post. It is corrected above now.

_____________________________________________________________________________________
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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes
mdevaney
Super User III
Super User III

@powerapps890 

I think you should simplify the code to only this code below.  The 2nd part of your conditional statement is what caused the checkboxes to disappear.

 

 

!CR_1.Text = "95 Blocked/On-Hold"

 


If you want to disable the checkbox instead of making it invisible put this code in the DisplayMode property

 

If(!CR_1.Text = "95 Blocked/On-Hold", DisplayMode.Edit, DisplayMode.Disabled)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

this causes all of the check boxes to become blank @mdevaney 

@powerapps890 

Please change your formula to this:

!(CR1.Text = "95 Blocked/On-Hold") || Self.Value

_____________________________________________________________________________________
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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

@powerapps890 @mdevaney 

You've got to enclose your comparison in parens if you are going to ! Not them!!

_____________________________________________________________________________________
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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (3,464)