cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
anthonys123
Helper III
Helper III

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

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. 

1 ACCEPTED SOLUTION

Accepted Solutions
TheRobRush
Super User
Super User

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

_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!

View solution in original post

2 REPLIES 2
TheRobRush
Super User
Super User

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

_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!
anthonys123
Helper III
Helper III

I like the simplicity. Thanks!

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 (2,066)