# Is there a way to populate a table/dataset with tag information dynamically?

**URL:** <https://forum.inductiveautomation.com/t/is-there-a-way-to-populate-a-table-dataset-with-tag-information-dynamically/101087>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [January 20, 2025, 12:59am UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-populate-a-table-dataset-with-tag-information-dynamically/101087 "2025-01-20T00:59:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_de\_Vaal](https://avatars.discourse-cdn.com/v4/letter/d/a9adbd/32.png) [@David\_de\_Vaal](https://forum.inductiveautomation.com/u/David_de_Vaal)\
**Post date:** [January 20, 2025, 12:59am UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-populate-a-table-dataset-with-tag-information-dynamically/101087/1 "2025-01-20T00:59:39Z")

</div>

I'm new to ignition so please excuse any incorrect terminology.

I have a UDT called Alarms which consists of 8 tags. One of the tags is called State, whos value ranges from 1 to 4 (integer). i want to create a table/dataset that contains the values of the 8 tags (including State) for any instance of Alarms where the value of State does not equal 4. Is there a way to do this?

---

<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 20, 2025, 4:53pm UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-populate-a-table-dataset-with-tag-information-dynamically/101087/2 "2025-01-20T16:53:25Z")

</div>

Short answer is yes, probably via scripting or by using pturmels' [Integration Toolkit](https://forum.inductiveautomation.com/t/automation-professionals-integration-toolkit-module/74934/179) to use an expression tag instead of a script.

Basic outline would be to use a Gateway Tag Change event, or maybe a Timer event, to monitor the state value of all the UDT's, and on change (or a set rate when using timer), loop through all the UDT's and collect the tag values of all UDT's where the state does not equal 4.

Depending on the number of instances you could fetch all UDT's and their tag values or you could do an Initial fetch of the State tag values and use that to build the larger list for fetching the additional values.

You would then build your dataset from these values and place it into a Gateway Memory tag for storage/display.

---

<div class="post-metadata">

**Author:** ![David\_de\_Vaal](https://avatars.discourse-cdn.com/v4/letter/d/a9adbd/32.png) [@David\_de\_Vaal](https://forum.inductiveautomation.com/u/David_de_Vaal)\
**Post date:** [January 21, 2025, 1:49am UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-populate-a-table-dataset-with-tag-information-dynamically/101087/3 "2025-01-21T01:49:00Z")

</div>

hey mate, appreciate the response. I have added a project library script that populates the table as expected, but i was just wondering if there is a way to prevent the script from running when it doesnt need to? pretty much, is there a way for the script to fire only when the table needs to be updated?

---

<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:** [January 21, 2025, 2:01am UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-populate-a-table-dataset-with-tag-information-dynamically/101087/4 "2025-01-21T02:01:45Z")

</div>

Only call it when it needs updated?

How are you calling it now?

---

<div class="post-metadata">

**Author:** ![David\_de\_Vaal](https://avatars.discourse-cdn.com/v4/letter/d/a9adbd/32.png) [@David\_de\_Vaal](https://forum.inductiveautomation.com/u/David_de_Vaal)\
**Post date:** [January 21, 2025, 2:06am UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-populate-a-table-dataset-with-tag-information-dynamically/101087/5 "2025-01-21T02:06:15Z")

</div>

i have a dataset custom property, and it is bound to the following expression:  
runScript("test.PopulateTable", 1000)

---

<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:** [January 21, 2025, 4:16am UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-populate-a-table-dataset-with-tag-information-dynamically/101087/6 "2025-01-21T04:16:43Z")

</div>

If you change the 1000 to 0, it will only execute once at view load. Then you can provide a button or other means with a click event for the user to trigger the same script.
