Here’s my script:

```
import re
operators = {
">" : (lambda x,y: x>y),
">=" : (lambda x,y: x>=y),
"<" : (lambda x,y: x<y),
"<=" : (lambda x,y: x<=y),
"==" : (lambda x,y: x==y),
"<>" : (lambda x,y: x<>y)
}
output = []
Dataset = system.dataset.toPyDataSet(self.custom.Dataset)
ColumnHeaders = system.dataset.getColumnHeaders(self.custom.Dataset)
if len(value) == 0:
output = shared.Data.datasetToJSON(self.custom.Dataset)
else:
for row in Dataset:
AddRow = True
for filter in value:
if filter["Expression"] in [">",">=","<","<=","==","<>"]:
# if not operators[filter["Expression"]] (row[filter["Column"]], filter["Value1"]):
if not row[filter["Column"]] > filter["Value1"]:
AddRow = False
elif filter["Expression"] == "between":
if not eval(str(row[filter["Column"]]) >= str(filter["Value1"]) and str(row[filter["Column"]]) <= str(filter["Value2"])):
AddRow = False
elif filter["Expression"] == "in":
pass
elif filter["Expression"] == "contains":
if not re.search(str(filter["Value"]), str(row[filter["Column"]])):
AddRow = False
if AddRow:
row_object = {}
row_value = {}
row_style = {}
for col in ColumnHeaders:
row_value[col] = row[col]
row_object["value"] = row_value
row_object["style"] = row_style
output.append(row_object)
return output
```

this results in the following error:

if I try to return row[filter[“Column”]] > filter[“Value1”], it works:

I’m not sure why it can evaluate the expression when I’m returning it, but it can’t evaluate in the context of an if statement…

Any help would be greatly appreciated.

EDIT:

Wanted to show what the values look like if returned on their own: