Table Row Color based on Similar cell

Hello All!,

I have a table with multiple rows that has a column called group_id. How can I have the table display each group_id with the same color. So if I had 3 group_id of ABC and 3 group_id of DEF then all ABC rows need to be the same color and all DEF rows be the same color as well.

Any help would be appreciated.

Thanks,

One way to do this is by looking at each row and defining colors based on the value. You want to be able to set the row color based on some data, but you'll need to either define each possible Group ID in the settings or create a lookup table for you to manage the different groups and the colors you want to show.

Like this:

You can probably script a better case statement if you don't care about the colors per group and just that they have different colors.

Thanks for the quick reply @pyrrho ! Problem I am facing is that new rows get added throughout the day and the group_id is randomly generated so I was hoping there was a way to grouo all rows by group_id somehow.

But I appreciate your reply!

You can definitely get all the unique group_ids using the lodash function uniqBy:

_.uniqBy(table2.data, 'group_id')

You can also enable grouping on the table for that field:
image