# 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:** 23

<div class="post-metadata">

**Author:** ![JantjeBeton](https://avatars.discourse-cdn.com/v4/letter/j/ea666f/32.png) [@JantjeBeton](https://forum.inductiveautomation.com/u/JantjeBeton)\
**Post date:** [October 8, 2025, 12:47pm UTC](https://forum.inductiveautomation.com/t/integration-toolkit-solutions-wiki/105080/23 "2025-10-08T12:47:18Z")

</div>

## Iterating through an array-tag to determine if value is present

Casus: A camera is selected on a video-wall if it’s ID (UDT-parameter) is present in a tag of the type Integer array (external system). So I want to use an expression-tag to determine if the camera is selected (boolean).

Approach: Iterate through the array with forEach (or where?) and compare each value to the integer ID-value. If found -\> true, else false

> **Initial expression**
>
> forEach returns a list if expression is met?  
> Then check if this list has one or more entries.
> 
> ```python
> if(
> len(
> forEach( 
> {[~]MSBS/SLKRS1_I1/CCTV/Pnl/STS/CameraNr.value}, 
> it() = {ArrayID}
> )
> ) > 0,
> true,
> false
> )
> 
> ```
> 
> Status: Error in the tag (Error Config)? What do I do wrong?  
> Tips:  
> `forEach()` always returns a list. But per my previous reply, use `where()` instead of `forEach()`. Do not wrap an `if()` around the whole thing, as a comparison with `len()` yields a boolean directly.

> **Improved expression**
>
> Note: I've moved the source (array) tag to be in the same folder as the expression-tag in order to supply an export-file (attached) if anybody is interested in reproducing/solving the issue.
> 
> ```python
> len(
> where( 
> {[.]CameraNr.value}, 
> it() = {ArrayID}
> )
> ) > 0
> 
> ```
> 
> Previous improvements applied, still an Error\_Configuration (Error writing to Geselecteerd.value: Bad\_Unsupported)

[ExpressionTagAndSource.json](https://forum.inductiveautomation.com/uploads/short-url/70ovzl90r6io7bnKMuGdpiKggA4.json) (784 Bytes)

---

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