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 / Interlocking Buttons -...
Power Apps
Answered

Interlocking Buttons - 'deselecting' a button when another is selected.

(0) ShareShare
ReportReport
Posted on by 483

I'm using 

Set(var1,Filter(Choices(test.status),Value="Reject"))

as found here to choose a value in a SharePoint list. 

 

I'm also using 

Button1.OnSelect = UpdateContext({ toggleValue: !toggleValue })

as found here to change the appearance of the button. 

 

So my initial formula for all six buttons looked something like this before I learned that this affects all buttons at the same time. 

OnSelect = Set(var1,Filter(Choices(test.status),Value="Reject"))&UpdateContext({ toggleValue: !toggleValue})

Color= If(toggleValue, Color.White, Color.Yellow)

 

I've updated each button with toggleValue1 or toggleValue2, etc. so each selection only affects the button that's pressed. 

 

What I need help with is DEselecting a button when another button is pressed.  

 

So if button 1 is selected the color goes to yellow. Then if button 2 is selected, button 1 text should turn white and button two text should go yellow. 

Categories:
I have the same question (0)
  • Verified answer
    TheRobRush Profile Picture
    11,128 Moderator on at

    For my Example I threw out 6 buttons, every one of them has the OnSelect of 

    Set(buttonName,Self)

    and a Color of

    If(buttonName=Self,White,HotPink)

    This changes the button text color to white for whichever button was most recently pressed, while all others will be pink

  • anthonys123 Profile Picture
    483 on at

    I like the simplicity. Thanks!

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 610

#2
Haque Profile Picture

Haque 317

#3
WarrenBelz Profile Picture

WarrenBelz 315 Most Valuable Professional

Last 30 days Overall leaderboard