# Showing a list in a label

**URL:** <https://forum.inductiveautomation.com/t/showing-a-list-in-a-label/101365>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [January 24, 2025, 8:26pm UTC](https://forum.inductiveautomation.com/t/showing-a-list-in-a-label/101365 "2025-01-24T20:26:37Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mjohnson0238](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@mjohnson0238](https://forum.inductiveautomation.com/u/mjohnson0238)\
**Post date:** [January 24, 2025, 8:26pm UTC](https://forum.inductiveautomation.com/t/showing-a-list-in-a-label/101365/1 "2025-01-24T20:26:37Z")

</div>

Good afternoon. I have an expression tag that looks at the boolean status of a tag and adds them together to get a total of how many are off/0:

```python
{[.]2/Cobot OPC Tags/OPC_Status}+
{[.]3/Cobot OPC Tags/OPC_Status}+
{[.]4/Cobot OPC Tags/OPC_Status}+
{[.]5/Cobot OPC Tags/OPC_Status}+
{[.]6/Cobot OPC Tags/OPC_Status}+
{[.]7/Cobot OPC Tags/OPC_Status}+
{[.]8/Cobot OPC Tags/OPC_Status}+
{[.]9/Cobot OPC Tags/OPC_Status}+
{[.]10/Cobot OPC Tags/OPC_Status}+
{[.]11/Cobot OPC Tags/OPC_Status}+
{[.]12/Cobot OPC Tags/OPC_Status}+
{[.]13/Cobot OPC Tags/OPC_Status}+
{[.]14/Cobot OPC Tags/OPC_Status}+
{[.]15/Cobot OPC Tags/OPC_Status}+
{[.]16/Cobot OPC Tags/OPC_Status}+
{[.]17/Cobot OPC Tags/OPC_Status}+
{[.]18/Cobot OPC Tags/OPC_Status}+
{[.]19/Cobot OPC Tags/OPC_Status}+
{[.]20/Cobot OPC Tags/OPC_Status}+
{[.]21/Cobot OPC Tags/OPC_Status}+
{[.]22/Cobot OPC Tags/OPC_Status}+
{[.]23/Cobot OPC Tags/OPC_Status}+
{[.]24/Cobot OPC Tags/OPC_Status}+
{[.]25/Cobot OPC Tags/OPC_Status}+
{[.]27/Cobot OPC Tags/OPC_Status}+
{[.]28/Cobot OPC Tags/OPC_Status}+
{[.]29/Cobot OPC Tags/OPC_Status}+
{[.]30/Cobot OPC Tags/OPC_Status}+
{[.]31/Cobot OPC Tags/OPC_Status}+
{[.]32/Cobot OPC Tags/OPC_Status}

```

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/1/319737c5a411361e30d6b8d6593a67bad7e8016b.png)

Is there a way for me to see which ones are of those 7 in an off/0 state, like a list of them? I.e. cobot 2, cobot 5, etc..? in a label.

---

<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 24, 2025, 8:40pm UTC](https://forum.inductiveautomation.com/t/showing-a-list-in-a-label/101365/2 "2025-01-24T20:40:22Z")

</div>

I would use my Integration Toolkit's `tags()` and `where()` functions to monitor those tags and post-process the list to prune out the ones that are OK.

---

<div class="post-metadata">

**Author:** ![mjohnson0238](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@mjohnson0238](https://forum.inductiveautomation.com/u/mjohnson0238)\
**Post date:** [January 24, 2025, 8:53pm UTC](https://forum.inductiveautomation.com/t/showing-a-list-in-a-label/101365/3 "2025-01-24T20:53:24Z")

</div>

Phil, can you share a link to that for me?

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [January 24, 2025, 8:54pm UTC](https://forum.inductiveautomation.com/t/showing-a-list-in-a-label/101365/4 "2025-01-24T20:54:01Z")

</div>

> [@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:** ![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 24, 2025, 10:53pm UTC](https://forum.inductiveautomation.com/t/showing-a-list-in-a-label/101365/5 "2025-01-24T22:53:05Z")

</div>

I recommend using two tags for future convenience. One dataset memory tag to hold the list of tag names to monitor, and one dataset expression tag to hold the pruned result. There's one nuance to deal with: dataset tags are not allowed to have columns of type `Object`, which is what you get from `tags()`, since it potentially must handle tags of many different data types.

The tag holding tag names needs to be just a single string column. The `[.]` syntax is allowed. Say it is called `OPC_Status_List`.

The expression tag would have this:

```python
where(
	unionAll(
		asMap('Tag', 'str', 'Status', 'B'),
		tags({[.]OPC_Status_List})
	),
	!it()[1] // Return rows where the second column is not boolean true.
)

```

The `unionAll()` coerces each row to be a string and a boolean, instead of a string and an `Object`.

---

<div class="post-metadata">

**Author:** ![mjohnson0238](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@mjohnson0238](https://forum.inductiveautomation.com/u/mjohnson0238)\
**Post date:** [January 25, 2025, 12:54pm UTC](https://forum.inductiveautomation.com/t/showing-a-list-in-a-label/101365/6 "2025-01-25T12:54:55Z")

</div>

What is 'B' in this case?

---

<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 25, 2025, 2:20pm UTC](https://forum.inductiveautomation.com/t/showing-a-list-in-a-label/101365/7 "2025-01-25T14:20:17Z")

</div>

It is the datatype to use for the 2nd column: Boolean. I use the same conventions as IA:

> **[system.dataset.fromCSV | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-dataset/system-dataset-fromCSV)**
>
> Converts a dataset stored in a CSV formatted string to a dataset that can be immediately assignable to a dataset property in your project.
