How to create a boolean from a PowerTable data

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.

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?

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:

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
		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:

Thank you, I’ll give it a try.