cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MJDynamics
New Member

How to change the colour of an icon when selecting a button

Please can you kindly assist with the functionality in changing the colour of this circle icon when selecting the "Activity Complete" button.

I want the colour of the circle to change to green when the activity complete button is selected/clicked:

MJDynamics_0-1633950337080.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @MJDynamics ,

 

I did a simple demo for you.

1\ Insert a button control into gallery and set its onselect property to:

Collect(Col,ThisItem)

 

2\ Insert a Circle control into gallery and set its Fill property to:

If(ThisItem in Col,Red,Blue)

 

The result is as follows:

AAA.gif

 

Best Regards,

Wearsky

View solution in original post

4 REPLIES 4
WarrenBelz
Super User
Super User

Hi @MJDynamics ,

I assume you are Patching to a field when you press the Activity Complete button. If this is the case, the Color of the icon needs to be

If(
   ThisItem.TheFieldName=TheCompleteValue.
   Green,
   Red
)

 

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 WarrenBelz,

 

Thank you for your response.

 

There is no patching functionality onselect on the Activity Complete button, it would just simply be to be able to change the colour of the red icon colour to green to show the activity has been completed.

v-xiaochen-msft
Community Support
Community Support

Hi @MJDynamics ,

 

I did a simple demo for you.

1\ Insert a button control into gallery and set its onselect property to:

Collect(Col,ThisItem)

 

2\ Insert a Circle control into gallery and set its Fill property to:

If(ThisItem in Col,Red,Blue)

 

The result is as follows:

AAA.gif

 

Best Regards,

Wearsky

I wanted to ask. How about if you want to return back the color if the user presses the button a second time.

 

Thanks,

Sh

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,249)