I have 3 buttons here. When I click on button 1 , the background of button need to change it to blue and others are white. And again when I click on button 2, then button 1 and button 3 should be white and button 2 background should be blue. Please suggest , how to do it.
My requirement is to show the current selected button.
Now when I select button 1 , all button color get changed to blue but I need only selected one.
Solved! Go to Solution.
You need two Variables
On button 1
UpdateContext(
{
OneClicked:true,
TwoClicked,false
}
)
Button 2
UpdateContext(
{
TwoClicked:true,
OneClicked,false
}
)
Fill of Button 1
If(
OneClicked
MidnightBlue,
White
)
Then button 2 Fill
If(
TwoClicked
MidnightBlue,
White
)
I am assuming Button 3 simply stays white.
This is a logic more than a coding/syntax issue - the above should work, but I am sure you will get the idea.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Hi @rswain44 ,
Set some Variables on the OnSelect of the buttons
UpdateContext({OneClicked:true})
Then the Fill of Button 1
If(
OneClicked,
Blue,
White
)
An so on for the others - ensure you set the variables to false on screen entry.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
I am not sure i am doing it in right way. Please check once.
Step 1: In button 1 -OnSelect-- UpdateContext({CurrentSelect:true}) --------I Added this formula
Step 2: In button 1 -fill - I added below formula.
If(
CurrentSelect,
MidnightBlue,
White
)
Step 3: Next in button 2--onselect- I Added this formula--Set(CurrentSelect,"false")
Step 4: button 2 --Fill-- I added the same code which I added in button 1 fill .
Finally its not working. I am sure , i did something wrong here. Please advise.
Now my all buttons are changed to blue and no color change after click on any button.
You need two Variables
On button 1
UpdateContext(
{
OneClicked:true,
TwoClicked,false
}
)
Button 2
UpdateContext(
{
TwoClicked:true,
OneClicked,false
}
)
Fill of Button 1
If(
OneClicked
MidnightBlue,
White
)
Then button 2 Fill
If(
TwoClicked
MidnightBlue,
White
)
I am assuming Button 3 simply stays white.
This is a logic more than a coding/syntax issue - the above should work, but I am sure you will get the idea.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
How do you reset the button variable OneClicked and TwoClicked when changing pages?
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
197 | |
47 | |
43 | |
41 | |
36 |
User | Count |
---|---|
287 | |
81 | |
80 | |
79 | |
71 |