Hi.
I´m trying to copy some columns of a selected row from a power table to another trough a button with next script:
# 1. Get references to the tables
sourceTable = event.source.parent.getComponent('QueryPowerTable')
destTable = event.source.parent.getComponent('PowerTable')
# 2. Get the selected row index
selectedRowData = sourceTable.selectedRow
print selectedRowData
if selectedRowData != -1:
columnsToCopy = ['MachineID']
filteredData = system.dataset.filterColumns(selectedRowData, columnsToCopy)
# 4. Append to destination table
newDestData = system.dataset.appendDataset(destTable.data, filteredData)
destTable.data = newDestData
else:
system.gui.messageBox("Please select a row first.")
Howerver, next error message appears:
'File "event:actionPerformed", line 16, in TypeError: filterColumns(): 1st arg can't be coerced to com.inductiveautomation.ignition.common.Dataset'
line 16... filteredData = system.dataset.filterColumns(selectedRowData, columnsToCopy)