How to count filtered rows in a power table

I have a Vision power table with a filterable column. I have a label where I show the number of rows when the table is loaded\updated; I get the number of rows with getRowCount(), but it shows the TOTAL number of rows, and I only want the number of rows in the table when the user filters the data. I would appreciate any directions.

Thank you very much for your prompt responses. For those who are new to Ignition, here is how it works:

#Get the number of ALL rows in the table (both filtered and unfiltered.)
data = event.source.parent.getComponent(‘Power Table’).data
count = data.getRowCount()

#Get ONLY the number of rows currently being displayed on the table (filtered rows.)
data = event.source.parent.getComponent(‘Power Table’).viewDataset
count = data.getRowCount()

Check out the manual, Vision - Power Table - Ignition User Manual 8.1 - Ignition Documentation

There is a property view dataset that you can reference for length.

Check props.filter.results.data. It gives an array of the filtered data.

Table filter row count

My filtered rows display on top is using an expression binding:
len({../Table.props.filter.results.data})

That’s assuming Perspective, he did say Power Table, which is Vision, Perspective’s table is called table, not power table. But, now he has both so he should be set either way. :slight_smile:

1 Like

Thank you, Transistor. I did not specify I am working in Vision.

Thank you, jlandwerlen. viewDataset is what I needed.

1 Like