Conditional formatting based on cell value

In the Table, you can highlight certain values based on a specific condition by referencing the self {{value}}. Here are a few examplesπŸ‘‡

Highlighting cells in different colors

Let's say you have a list of customers and you want to monitor their state depending on the credit limit amount. You can highlight the limits which are less than 90k in red to easily identify the customers at risk. To do so, you need to open the column's View settings and specify the following condition in the Color field: {{value >= 90000 ? 'success' : 'danger'}}.

Displaying emojis based on the value

Another use case is to display emojis in the table which stand for, for example, customer satisfaction rate. Let's say from the customer survey you got a number of points but instead of plain numbers you can display emojis for easier processing and analytics.

As an example, we'll use the following:

  • πŸ˜” - responses with less than 20 points

  • πŸ™‚ - neutral, 20-70 points

  • 😍 - more than 70 points

Now, to map numeric values to corresponding emojis, you need to open the column's settings and first change the field type from Number to String. Then, you need to scroll down to the View settings section and specify the following code in the Mapper field:

{{value < 20 ? 'πŸ˜”' : value >= 20 && value < 70 ? 'πŸ™‚' : value >= 70 ? '😍' : ''}}

Last updated

Was this helpful?