Continuing the discussion from Tags color in tables is not working:
Hi all,
I'm not able to get custom tag coloring working despite trying a lot of different approaches in the post mentioned above.
From what I can see, self
is an object
rather than a string, so self === 'Active'
is always going to be false
.
This is the JS I have in Color:
{{ (self === 'Active') ? 'green' : 'red' }}
... everything is red.
ChatGPT suggested:
{{ (typeof self === 'string' && self.trim().toLowerCase() === 'active') ? 'green' : 'red' }}
Which is where I find self
appears to be an object not a string
Main ss. Trying to make Status === 'Active' -> Green
(to start with).
Self-hosted Retool Retool version 3.20.3
Thanks!
Nick