cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AdamH
Helper V
Helper V

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 III
Super User III

@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.
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 III
Super User III

@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.
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

AdamH
Helper V
Helper V

@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 III
Super User III

@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.
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
Helper V
Helper V

@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
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 (1,261)