web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Button Colour Change
Power Apps
Unanswered

Button Colour Change

(0) ShareShare
ReportReport
Posted on by 726

I have three buttons that OnSelect 

Set(varShowFormC1,!varShowFormC1); 
UpdateContext({OneClick:true})

 

I then have the fill set to 

If(OneClickLable.Text = "true", LightBlue, RGBA(0, 55, 104, 1) ) 

 

I have a label called OneClickLable with the text 

OneClick

 

When the button is selected it changes colour to light blue, bases on this OneClick context being true

 

amyharkus86_0-1657188814136.png

If it is false it goes back to the dark blue colour like the other two buttons, This is the same for those. 

 

I have added a X to clear the selections by setting the context back to false on select

UpdateContext({OneClick:false, TwoClick:false, ThreeClick:false})

 

What i would prefer is that this context is updated to false on a second click of the button instead of the X 

 

I have tried a couple things on the button but none of them are correct 

 

UpdateContext({OneClick:true}); If(OneClickLable.Text = "true", UpdateContext({OneClick:false}))

 

 

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @amyharkus86 

    I did it a different way.  The formulas are in the screenshot.  The radio control is shown in the screenshot for display purposes but would be hidden in your app.  The button OnSelect is shown over the button and the Fill property is under each one. The default for the radio control is "var"

    !1.jpg

  • amyharkus86 Profile Picture
    726 on at

    @Drrickryp  Thank you, For the most part this perfect, Just one problem 

    sometimes a user may select button 1 and 2 and need those both, Its not always and this or that, sometimes its a this and that... if that makes any sense!

     

    Would the best thing to do be to change the control to checkboxes?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,045

#2
Valantis Profile Picture

Valantis 675

#3
11manish Profile Picture

11manish 592

Last 30 days Overall leaderboard