Set Visibility of Template Instance in Repeater Dynamically

Hello all,
Is it possible to set visibility of an instance of a template within a template repeater dynamically, based on an expression or script that uses the value of a cell to filter witch rows in a dateset to extract?
Here’s what i mean, i want to make a overview page for a HMI witch has a selectable pie chart. beneath i have a template repeater with the thumbnail buttons for each machine. Now i made a dataset tag witch contains the tables with the different proprieties for the thumbnail tags (machine name, HMI page link, graphic, and status), witch the template repeater can use to build the thumbnails, and to witch the PLC’s can write the status of the machines, so it can all change dynamically.


Now i can extract what section of the pie chart is selected with event.source.selectedData but for the life of me i can’t figure a way on how i could sort the template repeater to only show for example machines with status 2 (yellow) witch have this status written to their status column in the dataset when the yellow part of the pie chart is selected. Could somebody point me in the right direction for an elegant solution? What would be the best way to implement something like this?

Put your full list of possible templates on a custom parameter somewhere.
Attach a script to your pie chart that will look through that dataset, find the rows that match the selected color, then call system.dataset.deleteRows to get a truncated database, and (in scripting) assign that to your template repeater.