# Power Table, color a row once a condition (between 2 columns) is met

**URL:** <https://forum.inductiveautomation.com/t/power-table-color-a-row-once-a-condition-between-2-columns-is-met/85710>\
**Category:** Ignition\
**Tags:** ignition81, vision\
**Created:** [February 14, 2024, 7:08pm UTC](https://forum.inductiveautomation.com/t/power-table-color-a-row-once-a-condition-between-2-columns-is-met/85710 "2024-02-14T19:08:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rigoberto.reyes](https://avatars.discourse-cdn.com/v4/letter/r/65b543/32.png) [@rigoberto.reyes](https://forum.inductiveautomation.com/u/rigoberto.reyes)\
**Post date:** [February 14, 2024, 7:08pm UTC](https://forum.inductiveautomation.com/t/power-table-color-a-row-once-a-condition-between-2-columns-is-met/85710/1 "2024-02-14T19:08:14Z")

</div>

Hi there.

I´m working with power table and I need to color a complete row once an "if" condition be met as follows;  
(colIndex = 10 and value \> 1100) and (colIndex = 7 and value = 'valve NOK')

How can I do this?

 ![imagen](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/9/89a79313503914ab19c96b523d06ae703f807852.png)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 14, 2024, 7:17pm UTC](https://forum.inductiveautomation.com/t/power-table-color-a-row-once-a-condition-between-2-columns-is-met/85710/2 "2024-02-14T19:17:19Z")

</div>

You will need to transform your data to include styling information in the values for each row that you want to highlight. See the Perspective table's sample data for how to shape your data.

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [February 16, 2024, 9:36am UTC](https://forum.inductiveautomation.com/t/power-table-color-a-row-once-a-condition-between-2-columns-is-met/85710/3 "2024-02-16T09:36:40Z")

</div>

In the designer, right click on the power table and select scripting in the popup. From there, enable the [configureCell extension function](https://www.docs.inductiveautomation.com/docs/8.1/appendix/components/vision-components/tables/power-table/power-table-scripting-functions#extension-functions).

> [@rigoberto.reyes](#):
>
> colIndex = 10

I don't usually used indexes for this sort of thing, even though the power table does differentiate between the view index and the initial dataset index. I prefer to use column names because if the query is changed at some point in the future, I feel like there is less of a chance that my script will break. Here is an example of how to do this in your use case:

```auto
#def configureCell(self, [...]):
	# Get the data from the dataset for the corresponding columns on the row of the cell being evaluated
	if self.data.getValueAt(rowIndex, 10) > 1100 and self.data.getValueAt(rowIndex, 7) == 'valve NOK':

		# Set the background to yellow
		return {'background': 'yellow'}

```

To use a column name instead of the index, the `getValueAt` call would look like this: `self.getValueAt(rowIndex, 'Information') > 1100`
