Can't seem to get conditional formatting rules to work for choice list

I would prefer to use ‘Bool’ for this column, but the Bool doesn’t seem to support Null/None (it gets converted to False).
So I am using a Choice list (True, False).
In the attached image, you can see i have a column called $ENERGY. I have a rule:

$ENERGY is None

and another

$ENERGY == 'True'

each should set the background colour. But, it seems to be ignored. What am I doing wrong?

Hi,
For the empty cell it should work with testing if the value is an empty string:

$ENERGY == ""

or

not $ENERGY 

For “True” it should be fine, maybe there’s a spacing in the choice string?

my example:

my conclusion here, you need to set the styles on the individual choice list items, and this works. Using conditional formatting doesn’t, presumably because the choice list items overrides.

Hey @Don_Bowman ,

Is your column type Choice or Choice List? With a Choice column, you can only select one value in the cell from your list of choices. Choice List allows you to select multiple values from your list of choices. With Choice List, the conditional formulas have to be written to look for values within a list.

I created an example with both column types here: Community #7792 - Grist

The column labeled Choice has the type Choice.

Here are conditional styles written for this column;


If the value in the cell is some specific string, it will set the style as noted.

The column labeled Choice List has the type Choice List

Here are the conditional styles written for this column;


With these, we have to remember that the value in the cell is actually a list - even though we only see a single value selected. We have the option to add more.

When looking for a specific value in a list, we have to see if that value is in the list so our conditional formula is "True" in $Choice_List.

When looking for an empty cell, we are looking for an empty list. We can check the length of the list. If it’s zero, then it’s an empty list so our formula is len($Choice_List) == 0.

If your choice values are True and False, I would recommend setting your column type to Choice since you would only ever select one of those values in a cell.

I hope this helps! Please let me know if you have any follow up questions.

1 Like