Displaying color enum values in a table

I have this table which has the verification status of all users. These are enum values ACCEPTED, REJECTED, PENDING. I want the badges to be colored according to these values (green for accepted, red for rejected and blue for pending). I could not find any documentation for this. Is this possible?

@Diptesh Welcome to the forum - yes this is possible - see my posted screen shot here: Tag (dropdown) from query - data format issue

@ScottR Thank you for the reply. However the linked solution does not work for me.

Moreover, the ternary operator will not satisfy my use case since I have more than 2 enum values.

I've checked in with Retool support, apparently it's a bug and they are working on a fix.

Awesome, is it expected to be fixed soon?

Haven't asked for an ETA as I'm currently using the "Background" color feature, speaking from experience they are pretty fast with these kind of things.

I can't see how this is a bug as it is working for me: If you have more than 1 value...simply do the following:
{{item == 'Fix Required'?'#F08080':'' || item == 'Cancelled'?'#ff4d4d':'' || item == 'In Progress'?'#F6F905':'' || item == 'Completed'?'#52a63e':'' }}

Not sure if we are on the same version...

I am running on cloud 2.94.6

1 Like

I am running the same version but it does not work for me too

Hi @Diptesh, @ScottR and @stefancvrkotic, Thanks for flagging this. The tag color appears to be broken only when the column is NOT editable. ScottR is right that this issue has been reported to our engineering team. I still don't have an ETA to share here for when this will be fixed, but I'll update this post when a fix goes out. In the meantime, if the column isn't editable, then you could use an HTML column with a custom selector and Custom CSS applied to that selector set on your app or Retool instance to replicate the styling of the tag column. Or you could use the Background color input on the column editor modal to color the column as necessary.

If the column is editable then the tag color input will only apply to non-custom values (values that are included in the Data source input array) unless 'Unique column values' is selected as the Data source input.

Hey all! Doing some circling around the forums to let people know that the Tag type is being deprecated specifically for Custom Columns, more info and a workaround here.

For normal columns, this behavior should be fixed! Let me know here if you're still seeing issues with the Tag type in columns that are not Custom Columns, and otherwise please refer to the linked thread with any questions :slightly_smiling_face:

what about multi-select within the table?

Multi-tag columns aren't currently supported but are something on the radar!

Hey folks! Would just like to mention that multi-tag columns are supported in the new table for anyone following this thread who might have missed it :slightly_smiling_face: