# Power table configure cell

**URL:** <https://forum.inductiveautomation.com/t/power-table-configure-cell/33911>\
**Category:** General Discussion\
**Tags:** ignition80\
**Created:** [April 14, 2020, 8:25am UTC](https://forum.inductiveautomation.com/t/power-table-configure-cell/33911 "2020-04-14T08:25:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yifeiliu08](https://avatars.discourse-cdn.com/v4/letter/y/bbe5ce/32.png) [@yifeiliu08](https://forum.inductiveautomation.com/u/yifeiliu08)\
**Post date:** [April 14, 2020, 8:25am UTC](https://forum.inductiveautomation.com/t/power-table-configure-cell/33911/1 "2020-04-14T08:25:57Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/8/84121494987dd3969953ec3f8bae650444d67c48.png)  
i have two scripting , every one can work correct , but if i put them together, only the upside logic can work , can you teach me how to scripting make them working together

```
if selected:
	return {'background': self.selectionBackground}
elif rowView % 2 == 0:
	return {'background': 'white'}
else:
	return {'background': '#DDDDDD'}
	
	
	
config={}
if colIndex in [6]:
		lostTime = self.data.getValueAt(rowIndex,"OEE")
		var = 0.95
		if lostTime > var:
			config["background"] = "#FF0000"
			config["foreground"]="00FF00"
		else:
			config["background"] = "#00FF00"
			config["foreground"]="FF0000"
return config
```

---

<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:** [April 14, 2020, 11:18am UTC](https://forum.inductiveautomation.com/t/power-table-configure-cell/33911/2 "2020-04-14T11:18:03Z")

</div>

Move the empty dictionary assignment ( `config={}` ) to the first line. Then make the three conditions at the top assign to `config['background']` instead of returning. Your bottom section never runs because the `return` statements cut off execution of the function.

---

<div class="post-metadata">

**Author:** ![yifeiliu08](https://avatars.discourse-cdn.com/v4/letter/y/bbe5ce/32.png) [@yifeiliu08](https://forum.inductiveautomation.com/u/yifeiliu08)\
**Post date:** [April 15, 2020, 1:28am UTC](https://forum.inductiveautomation.com/t/power-table-configure-cell/33911/4 "2020-04-15T01:28:29Z")

</div>

it works , thanks
