Toggle (Switch) Color Change if True or False (Add Conditional Style)

Hello,

This is probably a simple solution, and I am uncertain how to complete the task.

  1. I have a column called $Inv when this is filled in then the column $Copy_to_Inv toggles on.
    image

I would like to change the color of the toggle based on true or false status.

When I added this formula, nothing happened.
$Copy_to_Inv == “true”
the color is orange

$Copy_to_Inv == “false”
the color is red

Nothing happened when I added this.

Can you please provide the formula.

Thank you

Hi Jennifer,

Try changing the formula so that it equals True, like so

$Copy_to_Inv == True

‘True’ and ‘False’ are Python values. When you express true and false between quotes ("true"), the formula is evaluating a text string with the word “true”. The toggle column is a boolean column storing True or False values, not the text string “true”. That’s why it must be evaluated with the value True. It’s a bit confusing!

Separately, when the switch is set to False, it’s currently not possible to set the switch’s color, though you can set the cell’s fill color.

It would be nice to set the switch color on cells on False values as well! This is a +1 for making that possible.

You can also just use $Copy_to_Inv instead of $Copy_to_Inv == True, and not $Copy_to_Inv instead of $Copy_to_Inv == False.

3 Likes

Thank you Anais,

I added a capital T and F and that worked.

:blush:

1 Like

Good to know, thank you!