# Help with creating an expression that searches tag values

**URL:** <https://forum.inductiveautomation.com/t/help-with-creating-an-expression-that-searches-tag-values/103378>\
**Category:** General Discussion\
**Tags:** perspective\
**Created:** [March 7, 2025, 1:35pm UTC](https://forum.inductiveautomation.com/t/help-with-creating-an-expression-that-searches-tag-values/103378 "2025-03-07T13:35:31Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![sam.dickson](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@sam.dickson](https://forum.inductiveautomation.com/u/sam.dickson)\
**Post date:** [March 7, 2025, 1:35pm UTC](https://forum.inductiveautomation.com/t/help-with-creating-an-expression-that-searches-tag-values/103378/1 "2025-03-07T13:35:31Z")

</div>

I am trying to create a view that records flightbar information based on its location. Each of my tags for flightbars have a location parameter and I would like to create a view that when that location parameter matches the tank location then it will pull the remaining information from that flightbar tag, such as part, order, etc to display on the tank view. However, I have not had much luck figuring out a good process to go about it, whether to create a named query, indirect tag binding or a script that will search all the location parameters from the flightbar tags until it finds a match. Any guidance or a link to a previous problem that is similar to mine would be appreciated.  
Below is the tag list for flightbars as well as the parameters that are listed under each

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/8/3830dbe100ea8823dbe4cde85910af9689187508.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/6/e6624239e9a7c8323219c21773c1a2f3ab9ff71c.png)

---

<div class="post-metadata">

**Author:** ![calimero100582](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/calimero100582/32/18630_2.png) [@calimero100582](https://forum.inductiveautomation.com/u/calimero100582)\
**Post date:** [March 7, 2025, 1:39pm UTC](https://forum.inductiveautomation.com/t/help-with-creating-an-expression-that-searches-tag-values/103378/2 "2025-03-07T13:39:08Z")

</div>

Feel like you just need an indirect tag binding

> **[Tag Bindings in Perspective | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/ignition-modules/perspective/working-with-perspective-components/bindings-in-perspective/tag-bindings-in-perspective#indirect-tag-binding-mode)**
>
> A Tag binding is a straight-forward binding type. It simply binds a property directly to a Tag Property (typically the value). This sets up a subscription for that Tag. Every time the chosen Tag changes, the binding is evaluated and pushes the new...

---

<div class="post-metadata">

**Author:** ![Chris\_Bingham](https://avatars.discourse-cdn.com/v4/letter/c/e5b9ba/32.png) [@Chris\_Bingham](https://forum.inductiveautomation.com/u/Chris_Bingham)\
**Post date:** [March 7, 2025, 1:42pm UTC](https://forum.inductiveautomation.com/t/help-with-creating-an-expression-that-searches-tag-values/103378/3 "2025-03-07T13:42:10Z")

</div>

> [@sam.dickson](#):
>
> create a view

It may help to know the technology that you are working with (Vision, Perspective, etc.). If possible, tagging the post with the appropriate versions / modules will benefit others as well.

---

<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:** [March 7, 2025, 1:42pm UTC](https://forum.inductiveautomation.com/t/help-with-creating-an-expression-that-searches-tag-values/103378/4 "2025-03-07T13:42:25Z")

</div>

Sounds like you need my integration toolkit's [tags()](https://www.automation-pros.com/toolkit/doc/utility.html#tags) function to pull in all of the flightbar locations, then my [where()](https://www.automation-pros.com/toolkit/doc/iteration.html#where) function to pick out the matching location.

> [@Automation Professionals' Integration Toolkit Module](https://forum.inductiveautomation.com/t/automation-professionals-integration-toolkit-module/74934):
>
> Automation Professionals is pleased to announce the immediately availability of a major upgrade to its free Simulation Aids Integration Toolkit module. The new feature justifying the "major upgrade" language is the implementation of eleven thirty-one new expression functions which use iteration to accomplish complex transforms of datasets and lists, to or from other datasets and lists, applying filtering, ordering, and computed new columns along the way. While there are certain operations that…

---

<div class="post-metadata">

**Author:** ![sam.dickson](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@sam.dickson](https://forum.inductiveautomation.com/u/sam.dickson)\
**Post date:** [March 7, 2025, 3:24pm UTC](https://forum.inductiveautomation.com/t/help-with-creating-an-expression-that-searches-tag-values/103378/5 "2025-03-07T15:24:13Z")

</div>

Hello, I was leaning more towards using an indirect binding. My hangup that I am finding is creating a reference to that flightbar based on a custom parameter that I added to my view (view.params.Location1) where Location 1 is that Location on the tank that i want it to match with a location value in the flightbar tags. So i guess i am having trouble thinking of an expression that may do that.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/8/08a6b31e989599dc08263e6fefa68159e9f4edd2.png)

---

<div class="post-metadata">

**Author:** ![sam.dickson](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@sam.dickson](https://forum.inductiveautomation.com/u/sam.dickson)\
**Post date:** [March 7, 2025, 3:24pm UTC](https://forum.inductiveautomation.com/t/help-with-creating-an-expression-that-searches-tag-values/103378/6 "2025-03-07T15:24:56Z")

</div>

My apologies. I am using Perspective.

---

<div class="post-metadata">

**Author:** ![Chris\_Bingham](https://avatars.discourse-cdn.com/v4/letter/c/e5b9ba/32.png) [@Chris\_Bingham](https://forum.inductiveautomation.com/u/Chris_Bingham)\
**Post date:** [March 7, 2025, 3:33pm UTC](https://forum.inductiveautomation.com/t/help-with-creating-an-expression-that-searches-tag-values/103378/7 "2025-03-07T15:33:53Z")

</div>

If you are not regularly adding/removing Flightbars, consider:

- Create an expression structure binding as an array of locations. This binding would contain an array of all current values of all Flightbar locations. Something resembling:

```python
0: "Not Used"
1: {[NJ_Ludy]Ludy/Tags/Flightbar/Flightbar1/Location}
2: {[NJ_Ludy]Ludy/Tags/Flightbar/Flightbar2/Location}
3: ...

```

- Create another parameter which uses the `indexOf()` expression function to extract the index from the value which matches your desired location.
- Use the index from the previous step in your indirect bindings.
- Optionally, create a single folderPath property, containing the resultant value "[prov]path/to/Flightbar#", as a string, which all other (indirect) bindings in your view could reference.

---

<div class="post-metadata">

**Author:** ![sam.dickson](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@sam.dickson](https://forum.inductiveautomation.com/u/sam.dickson)\
**Post date:** [March 7, 2025, 8:57pm UTC](https://forum.inductiveautomation.com/t/help-with-creating-an-expression-that-searches-tag-values/103378/8 "2025-03-07T20:57:47Z")

</div>

Thank you, that seemed to work for what i needed for!
