How to aply this checkboxes as fitler transfrom with code
It would probably help to explain to readers that you want to construct a WHERE ... IN (chk_0, chk_1, ...) list for a named query.
Image from https://forum.inductiveautomation.com/t/large-dataset-filtering-from-custom-data/90478.
1 Like
Here's one way.
def transform(self, value, quality, timestamp):
selected = []
for row in value:
if row['select']:
selected.append(row['Filter'])
return '(' + ', '.join(selected) + ')'
Result: (One, Four, Seven, Ten, Thirteen)
You need to refresh this binding any time a selection is changed on the table.
Understand that this requires use of a QueryString in your named query and that has certain security risks.
1 Like