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

BUG: Button DisplayMode not recognizing boolean variable

I have a button that has a DisplayMode property set to only be "Edit" if a context variable is NOT 3:

 

 

 

 

 

Inkedpowerapps_button_onselect_not3_LI.jpg

 

 

The content of EstimateStatus is 2.  This is demonstrated by looking at the Text property of the EstimateStatus label selected below.  You will see is "Open" because the value of EstimateStatus variable is 2. So PowerApps recognized the EstimateStatus is 2:

 

InkedPowerApps_estimatestatus_LI.jpg

 

I also set a label text property to be the EstimateStatus variable and you'll see it also shows 2.

 

Inkedpowerapps_variable_content_LI (2).jpg

 

 

So if the EstimateStatus is 2 and the button should only be clickable if the EstimateStatus is 3, why is the button clickable?

 

 

1 REPLY 1
JRaasumaa
Memorable Member
Memorable Member

What happens if you switch those around and just say:

 

If(EstimateStatus = 3, DisplayMode.Edit, DisplayMode.Disabled)

 

Edit:

 

I think I misread: "I have a button that has a DisplayMode property set to only be "Edit" if a context variable is NOT 3:"

 

If you want it to be able to be edited when DisplayMode is not 3 then checking to see if it is 3 would mean you disable it, switch my code around.

 

If(EstimateStatus = 3, DisplayMode.Disabled, DisplayMode.Edit)

That means if it's ever 3 it's disabled, anything else for a value it's clickable.

Helpful resources

Announcements
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,636)