# How to create a boolean from a PowerTable data

**URL:** <https://forum.inductiveautomation.com/t/how-to-create-a-boolean-from-a-powertable-data/53229>\
**Category:** Ignition\
**Created:** [November 18, 2021, 6:53am UTC](https://forum.inductiveautomation.com/t/how-to-create-a-boolean-from-a-powertable-data/53229 "2021-11-18T06:53:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmonter](https://avatars.discourse-cdn.com/v4/letter/j/858c86/32.png) [@jmonter](https://forum.inductiveautomation.com/u/jmonter)\
**Post date:** [November 18, 2021, 6:53am UTC](https://forum.inductiveautomation.com/t/how-to-create-a-boolean-from-a-powertable-data/53229/1 "2021-11-18T06:53:54Z")

</div>

Hello,  
I have a customer that uses power table that is use to start/stop pumps, the operator can add pumps from a per-determine pump selection. Once the pump is on the power table the operator can start/stop/remove the pump, the status of the pump is updated based on the pump’s tag (stop/running). What he wants to do now is that if any of the pumps in the power table are Running to disable another button.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/a/aa8ae2f9fb1ca3cf2a22129f6946451f0a7ab2e9.png)

I don’t know how I retrieve the list from the power table to create a boolean variable that can be use to disable the other button. Could anyone help?  
Thanks.

---

<div class="post-metadata">

**Author:** ![leonardo.godoi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/leonardo.godoi/32/27178_2.png) [@leonardo.godoi](https://forum.inductiveautomation.com/u/leonardo.godoi)\
**Post date:** [November 18, 2021, 2:31pm UTC](https://forum.inductiveautomation.com/t/how-to-create-a-boolean-from-a-powertable-data/53229/2 "2021-11-18T14:31:06Z")

</div>

You want to just retrieve the list of active pumps? If so, assuming that these are the correct column names, it should do the trick:

```auto
pumpDataset = #insert here a reference to the 'data' property of the PowerTable
for row in range(0,pumpDataset.getRowCount()):
	pumpName = pumpDataset.getValueAt(row,'Pump')
	pumpStatus = pumpDataset.getValueAt(row,'Status')
	if pumpStatus == 'Stop':
		pumpStatus = False
	else:
		pumpStatus = True	
	print (pumpName,pumpStatus)

```

You can also find out more about the functions of “getValueAt()”, “getRowCount()” and many others relating to the use of datasets here:  
[https://docs.inductiveautomation.com/display/DOC81/Datasets](https://docs.inductiveautomation.com/display/DOC81/Datasets)

---

<div class="post-metadata">

**Author:** ![jmonter](https://avatars.discourse-cdn.com/v4/letter/j/858c86/32.png) [@jmonter](https://forum.inductiveautomation.com/u/jmonter)\
**Post date:** [November 19, 2021, 3:27pm UTC](https://forum.inductiveautomation.com/t/how-to-create-a-boolean-from-a-powertable-data/53229/3 "2021-11-19T15:27:28Z")

</div>

Thank you, I’ll give it a try.
