# Additional filters for Table function binding in Ignition Edge

**URL:** <https://forum.inductiveautomation.com/t/additional-filters-for-table-function-binding-in-ignition-edge/38283>\
**Category:** Ignition\
**Created:** [September 2, 2020, 6:31am UTC](https://forum.inductiveautomation.com/t/additional-filters-for-table-function-binding-in-ignition-edge/38283 "2020-09-02T06:31:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![yin.cheng](https://avatars.discourse-cdn.com/v4/letter/y/85f322/32.png) [@yin.cheng](https://forum.inductiveautomation.com/u/yin.cheng)\
**Post date:** [September 2, 2020, 6:31am UTC](https://forum.inductiveautomation.com/t/additional-filters-for-table-function-binding-in-ignition-edge/38283/1 "2020-09-02T06:31:46Z")

</div>

Hi

I am using Ignition Edge 8.0.13  
I am binding my table data to audit log through Functions-\>Binding Function-\>Audit Log  
I need to filter both “Tank” and “Pump” in the Target Filter.  
If i type in %Tank%, i am able to see those audit logs related to Tank only.  
If i wanna see both Tank and Pump, i have tried:  
%Tank% %Pump%  
%Tank% , %Pump%  
%Tank% && %Pump%  
%Tank% AND %Pump%  
But these methods are not working…

Can someone tell me how could i include in those filters? As there is no SQL Query option available.

---

<div class="post-metadata">

**Author:** ![abiesbiogas](https://avatars.discourse-cdn.com/v4/letter/a/919ad9/32.png) [@abiesbiogas](https://forum.inductiveautomation.com/u/abiesbiogas)\
**Post date:** [December 28, 2020, 11:36am UTC](https://forum.inductiveautomation.com/t/additional-filters-for-table-function-binding-in-ignition-edge/38283/2 "2020-12-28T11:36:47Z")

</div>

Hello 🙂  
let me understand:  
if you need to filter all the records that contain both the word “Tank” and “Pump” in the same row you should use this filter:

%Tank%Pump%

important: the order of the words matter and this will find:

SomeTextTankfooPumpSometext  
but won’t find

SomeTextPumpfooTankSometext

If you need to retrieve alla the records that contain Pump OR Tank, seems like the Audit log function can’t achieve your purpouse.

A SQL Query binding in the Data property of the table could, try this:

```auto
SELECT AUDIT_EVENTS_ID
, EVENT_TIMESTAMP as Timestamp
, ACTOR as Actor
, ACTOR_HOST
, ACTION as Action
, ACTION_TARGET as "Action Target"
, ACTION_VALUE as "Action Value"
, STATUS_CODE as "Result Code"
, ORIGINATING_SYSTEM as System
, ORIGINATING_CONTEXT as "Context Code"
FROM AUDIT_EVENTI
WHERE (ACTION_TARGET like '%Tank%') or (ACTION_TARGET like '%Pump%')

```

---

<div class="post-metadata">

**Author:** ![yin.cheng](https://avatars.discourse-cdn.com/v4/letter/y/85f322/32.png) [@yin.cheng](https://forum.inductiveautomation.com/u/yin.cheng)\
**Post date:** [January 18, 2021, 10:30am UTC](https://forum.inductiveautomation.com/t/additional-filters-for-table-function-binding-in-ignition-edge/38283/3 "2021-01-18T10:30:10Z")

</div>

Hi Abiesbiogas

Thank you for replying and sharing the script!  
But i am using Ignition Edge, whereby i cant use the SQL Query binding method…  
Below is the screenshot of the table’s property binding for your info.

 ![edge](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/6/560e11e2af03d72fbf7a36d0bc6d86c6cde6620e.png)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 18, 2021, 1:01pm UTC](https://forum.inductiveautomation.com/t/additional-filters-for-table-function-binding-in-ignition-edge/38283/4 "2021-01-18T13:01:11Z")

</div>

You’ll have to script your filter entirely in jython, using a propertyChange event. Bind the unfiltered data to a custom property (of type Dataset), and monitor its changes. The propertyChange script would write the new dataset with the desired rows to the table’s data property.

(I would normally recommend the view() expression function from my Simulation Aids module, but it isn’t allowed in Edge.)

---

<div class="post-metadata">

**Author:** ![abiesbiogas](https://avatars.discourse-cdn.com/v4/letter/a/919ad9/32.png) [@abiesbiogas](https://forum.inductiveautomation.com/u/abiesbiogas)\
**Post date:** [February 5, 2021, 4:42pm UTC](https://forum.inductiveautomation.com/t/additional-filters-for-table-function-binding-in-ignition-edge/38283/5 "2021-02-05T16:42:27Z")

</div>

hello, sorry for the delay. Actually I have no experience of Edge, but if you can’t run a sql query you have to do the “hard work” by yourself.

As pturmel suggested I would do something like this:

```auto
# place this code in the propertyChange event of your component
# unfiltered is your property containing the unfiltered data
if event.propertyName == "unfiltered":
	# transform it in a Pydataset this way you can iterate through each row
	pyAlarms = system.dataset.toPyDataSet(unfiltered)
	
	# collect only the rows matching your criteria
	rows = [row for row in pyAlarms if ("tank" in row['ACTION_TARGET']) or ("pump" in row['ACTION_TARGET']) ]
	
	# create the new dataset and return it
	header = system.dataset.getColumnHeaders(unfiltered)
	filtered = system.dataset.toDataSet(header, rows)

```

---

<div class="post-metadata">

**Author:** ![yin.cheng](https://avatars.discourse-cdn.com/v4/letter/y/85f322/32.png) [@yin.cheng](https://forum.inductiveautomation.com/u/yin.cheng)\
**Post date:** [February 12, 2021, 3:29pm UTC](https://forum.inductiveautomation.com/t/additional-filters-for-table-function-binding-in-ignition-edge/38283/6 "2021-02-12T15:29:12Z")

</div>

Hi Phil, thank you for the suggestion, would definitely try it!

---

<div class="post-metadata">

**Author:** ![yin.cheng](https://avatars.discourse-cdn.com/v4/letter/y/85f322/32.png) [@yin.cheng](https://forum.inductiveautomation.com/u/yin.cheng)\
**Post date:** [February 12, 2021, 3:30pm UTC](https://forum.inductiveautomation.com/t/additional-filters-for-table-function-binding-in-ignition-edge/38283/7 "2021-02-12T15:30:39Z")

</div>

Hi Abiesbiogas  
Thank you so much for the suggested script, i will try out and see how it turns out!
