Is there any way in Ignition where we can delete all existing rows in a date set using a script?
I know system.dataset.deleteRows(dataset, rowIndices) can delete the rows in the dataset given the dataset and row indices. But if we were to delete all at once (except the header), is there an easier way?
Unfortunately, using toDataset() with an empty list won’t retain the column datatypes. For that, you need something like this:from com.inductiveautomation.ignition.common import BasicDataset
ds = event.source.parent.getComponent('Table').data
ds0 = BasicDataset(ds.getColumnNames(), ds.getColumnTypes(), None)