# Integration Toolkit Solutions Wiki

**URL:** <https://forum.inductiveautomation.com/t/integration-toolkit-solutions-wiki/105080>\
**Category:** 3rd Party Modules\
**Tags:** scripting, ignition81\
**Created:** [April 14, 2025, 9:02pm UTC](https://forum.inductiveautomation.com/t/integration-toolkit-solutions-wiki/105080 "2025-04-14T21:02:36Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [April 15, 2025, 5:32pm UTC](https://forum.inductiveautomation.com/t/integration-toolkit-solutions-wiki/105080/6 "2025-04-15T17:32:21Z")

</div>

## Filtering datasets and emulating the IN operator

Many times you want to filter a dataset where a columns value is equal to one of any item in a list. In SQL this is possible by utilizing the 'IN' operator. However, outside of using a QueryString parameter, due to the way that Named Query parameters work you can not supply a List of values.

If you create a custom property to hold the raw data set from the named query, then you can use a simple expression binding to filter the dataset further in a similar manner to that seen when using the SQL `IN` operator.

> **Filtering by a List of Values**
>
> ```python
> unionAll(
> columnsOf({path.to.raw.data}),
> forEach(
> {path.to.List},
> where(
> {path.to.raw.data},
> it()['ColumnToFilter'] = it(1)
> )
> )
> )
> 
> ```

Note that for filtering by a single value, only the `where()` expression is needed.

> **Filtering by a Single Value**
>
> ```python
> where(
> {path.to.raw.data},
> it()['ColumnToFilter'] = {path.to.filter.value}
> )
> 
> ```

> **Features employed**
>
> - [Iterables](https://www.automation-pros.com/toolkit/doc/iteration.html#iterables) General behavior of all iterators.
> - [unionAll()](https://www.automation-pros.com/toolkit/doc/datasets.html#unionall) Assembles the list of filtered rows sources into a new filtered dataset.
> - [columnsOf()](https://www.automation-pros.com/toolkit/doc//datasets.html#columnsof) Returns an ordered map of the column names versus column type class names (as strings).
> - [forEach()](https://www.automation-pros.com/toolkit/doc/iteration.html#foreach) Loops through the list of items, for comparison in the conditional argument of the `where()` expression.
> - [where()](https://www.automation-pros.com/toolkit/doc/iteration.html#where) Prunes the source data according to supplied conditional expressions.
> - [it([depth])](https://www.automation-pros.com/toolkit/doc/iteration.html#it) Delivers the current iterations value based on the depth argument supplied.

Note that for static lists, the [asList()](https://www.automation-pros.com/toolkit/doc/iteration.html#asList) expression can be used in place of `{path.to.list}`

---

_[View the full topic](https://forum.inductiveautomation.com/t/integration-toolkit-solutions-wiki/105080)._
