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

Button Selection Indicators

Hello, I have a very simple three question screen where I must indicate a YES or NO for each question.  For each question, I have been able to get the YES or NO button to change color when I hover over the button, but how do I get the color to stay when I select it and if I change my mind, reset the other button back to it's original color?

 

If I click YES, I'd like it to stay highlighted until I hit submit or I change the answer to NO.

 

Here is what it looks like currently:

 

AaronTheYoung_0-1596086274383.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @AaronTheYoung ,

Do you want to change button's color based on which button you select?

For example: if you click "yes", the yes button is red, no button is green.

If you click "no", the yes button is green, no button is red.

 

You could set like this:
1)set yes button's OnSelect:

Set(var,true)

2)set no button's OnSelect:

Set(var,false)

3)set yes button's Color:

If(var,Red,Green)

4)set no button's Color:

If(!var,Red,Green)

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
eka24
Super User III
Super User III

Set a variable on the OnSelect of the Button. Add to Your formula

Yes Button

Set(YesColor, true);

 

No Button

Set(YesColor, false);


Then change the fill color of the button to: If(YesColor, Green, Blue)

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

 

v-yutliu-msft
Community Support
Community Support

Hi @AaronTheYoung ,

Do you want to change button's color based on which button you select?

For example: if you click "yes", the yes button is red, no button is green.

If you click "no", the yes button is green, no button is red.

 

You could set like this:
1)set yes button's OnSelect:

Set(var,true)

2)set no button's OnSelect:

Set(var,false)

3)set yes button's Color:

If(var,Red,Green)

4)set no button's Color:

If(!var,Red,Green)

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,093)