Conditional Formatting

I'm trying to create a conditional formatting color for a column. Imposible to do it

I'm doing this but retool isn't recognizing the "Active" or "Inactive" words.

{{ self === 'Active' ? '#08a977' : self === 'Inactive' ? '#fea424' : 'defaultColor' }}

Help please!

Hi Paula,

You might be looking to use the item keyword instead of self. item refers to the value of each cell in the table, while self refers to the entire table component. Hope this helps!

eg:
{{ item === 'Active' ? '#08a977' : item === 'Inactive' ? '#fea424' : 'defaultColor' }}

1 Like

Is not the Text color field for that?

Another gothca - I'd also double check that the value of those items are capitalised. I know that the table does some nice automatic formatting to uppercase the first letter on some column types - so if your data is actually active it may display as Active on screen but your === operator won't match it.

Thank you, Anna! I'm encountering an issue as the text color appears in the preview, but it doesn't show up when using the app.


Hi @PaulaG Thanks for flagging this bug! Any chance you're using releases on the app? I'm wondering if this change needs to be published as a new release in order to see it in Preview

1 Like

Hi, there is a related post with issues with Text color field in Table columns

Hi @Tess, thanks for following up! I am currently working with only one environment, so all changes are released immediately. However, this does not seem to apply to the text color change.
image

1 Like

Same issue

Okay the behavior has been pretty inconsistent for me :thinking: But I think I have enough to report this as a bug to our team. I'll post here with any follow up questions or updates!

2 Likes

This should be fixed now :crossed_fingers: Please let us know if you're still seeing issues here