cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
hughrmarks
Level: Powered On

Button effects

This seems easy but I can't figure it out.   I have a button with red Fill that needs to change to black Fill when pressed, then back to red when pressed again.   It needs to toggle back and forth regardless of how many times it is pressed.   Any suggestions?   Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Sienna
Level 10

Re: Button effects

You'll have to do it change variable buttonPressed on each button 

 

buttonPressed1

buttonPressed2

.

.

.

View solution in original post

8 REPLIES 8
Sienna
Level 10

Re: Button effects

In your OnSelect property of button add

 

UpdateContext({pressedButton:!true})

 

Change Fill property to

 

If(pressedButton=true, Color.Black, Color.Red)

Super User
Super User

Re: Button effects

Hi @Sienna

 

Yes, that's a good answer. But is this what you meant to say?

 

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

 

In your OnSelect property of button add

 

UpdateContext({pressedButton:!pressedButton})

 

Change Fill property to

 

If(pressedButton=true, Color.Black, Color.Red)

 

 

Sienna
Level 10

Re: Button effects

Hi @timl

Yes.. Thanks for correction... I wanted to do it old way at first and then I've changed my mind 🙂

Super User
Super User

Re: Button effects

No problem @Sienna! It was pretty obvious what you were getting at, but I thought I'd mention it just in case.

Sienna
Level 10

Re: Button effects

That is ok... Please always do if you spot some misstake. I usually do this on the go or while I'm waiting for PA to start responding again 😞

hughrmarks
Level: Powered On

Re: Button effects

Thanks very much.   This works but I have several different buttons on the same page.   I used these formulas for each but when I press one button it changes all of them black.   I know I need to specify the name of the particular button somewhere in there but I don't know where.

Sienna
Level 10

Re: Button effects

You'll have to do it change variable buttonPressed on each button 

 

buttonPressed1

buttonPressed2

.

.

.

View solution in original post

hughrmarks
Level: Powered On

Re: Button effects

@Sienna  Thank you!   This worked perfectly!

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 217 members 5,548 guests
Please welcome our newest community members: