# Programming help in power table

**URL:** <https://forum.inductiveautomation.com/t/programming-help-in-power-table/76985>\
**Category:** Ignition\
**Tags:** scripting, vision\
**Created:** [July 27, 2023, 3:27am UTC](https://forum.inductiveautomation.com/t/programming-help-in-power-table/76985 "2023-07-27T03:27:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shirshak\_Chhetri](https://avatars.discourse-cdn.com/v4/letter/s/c89c15/32.png) [@Shirshak\_Chhetri](https://forum.inductiveautomation.com/u/Shirshak_Chhetri)\
**Post date:** [July 27, 2023, 3:27am UTC](https://forum.inductiveautomation.com/t/programming-help-in-power-table/76985/1 "2023-07-27T03:27:55Z")

</div>

Hello All,

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/9/69d25d361e1a005c47135824bd2d12b45f920958.png)

On the power table above, how do I get the green highlight to turn red if its not on the same row as the blue. I have 4 custom property binding to tags. In general Blue Highlights the expected part, if the correct part is detected the green is supposed to highlight the cell in the same row as the expected part, and if any other part is detected its supposed to be highlighted in red.

Currently I am using this script

```auto

attributes = {'background': 'White', 'foreground': 'Black'}
	if colName == "Seed Tube Part Number" and value == self.PartNumber:
      	  attributes['background'] = 'Blue'
      	  attributes['foreground'] = 'White'
	if colName == "Program Number" and value == self.CurrentProgramNumber and self.Pass == True:
        	attributes['background'] = 'Green'
      		attributes['foreground'] = 'white'
	if colName == "Program Number" and value == self.CurrentProgramNumber and self.Fail == True:
			attributes['background'] = 'Red'
			attributes['foreground'] = 'white'
		return attributes

```

---

<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:** [July 27, 2023, 5:04am UTC](https://forum.inductiveautomation.com/t/programming-help-in-power-table/76985/2 "2023-07-27T05:04:08Z")

</div>

`self.Pass == True` should probably be `self.data.getValueAt(row, 2) == self.PartNumber`,  
and `self.Fail == True` should probably be `self.data.getValueAt(row, 2) != self.PartNumber`
