cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AdamH
Post Patron
Post Patron

Change a shape colour based on a toggle field

Hi All,

 

I want to change a colour of a circle based on a value of a toggle. 

So if the toggle is True - Circle is Green. If the toggle is False - Circle is Red.

button-toggle.png

At the moment, you can see the output I have above. 

 

Thanks!

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@AdamH 

Change the Fill property of the shape to:

If(yourToggleName.Value, Green, Red)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

5 REPLIES 5
RandyHayes
Super User
Super User

@AdamH 

Change the Fill property of the shape to:

If(yourToggleName.Value, Green, Red)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
AdamH
Post Patron
Post Patron

@RandyHayes 

 

My toggle is showing as a datacardvalue / DataCardKey7

2021-05-14 21_11_19-NC Codes - Saved (Unpublished) - Power Apps.png

 

 

 

Its the Manager Code field I'm trying to use

2021-05-14 21_13_31-Window.png

RandyHayes
Super User
Super User

@AdamH 

Then the formula is the same except with your control name in it.

   If(DataCardValue7.Value, Green, Red)

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
AdamH
Post Patron
Post Patron

@RandyHayes 

 

Yeah I thought that and tried that before I messaged you back, it's giving me 'IF' has invalid arguments. 

 

2021-05-14 21_23_50-NC Codes - Saved (Unpublished) - Power Apps.png

 

@RandyHayes 

 

Ignore me, It was my mistake, I was selecting datacardkey rather than value. 

 

Thanks @RandyHayes 

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Kudoed Authors
Users online (3,308)