Change color of row based on value

I have a table widget, and I’m going to the style tab and editing the “cell background color” field. I’m selecting Javascript and typing {{ currentRow.sunShipByDate = “” ? “Red” : “” }} and getting the error “currentRow is not defined”. This is strange because I’m following Appsmith help articles on the syntax for this.

I’m on the cloud version, not self-hosted so everything should be up to date. Any idea here?

You’re to change the style from the column settings of the sunShipByDate field.
Go to the column settings.

Click the settings Icon for your desired column and in the style tab, you can use the above syntax like so {{ currentRow.sunShipByDate == “” ? “Red” : “” }} .

1 Like

That turns a single column a color based on the script, right? I’m looking to change the entire row based on the data in a column.

You would have to set the condition for each column then.

That’s a shame. The table styling should be able to access the currentRow as well