Table conditional formatting more than two colours

Hi, I wish to have 3 or more colours for my conditional formatting on my table component in retool.

Currently I have {{ self.includes('Yes') ? 'green' : 'red' }} in the background colour component field and this works fine. But I would like to add in a 'Maybe' option which colours the background yellow and I have been unable to find an example.

Please help :slight_smile:

You need to nest your ternary like so:

{{ self.includes('Yes') ? 'green' : self.includes('Maybe') ? 'yellow' : 'red' }}

1 Like

Thank you!