# Can I Dynamically Input Data Into a UDT Parameter Based on a Query Tag?

**URL:** <https://forum.inductiveautomation.com/t/can-i-dynamically-input-data-into-a-udt-parameter-based-on-a-query-tag/106994>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [June 4, 2025, 6:48am UTC](https://forum.inductiveautomation.com/t/can-i-dynamically-input-data-into-a-udt-parameter-based-on-a-query-tag/106994 "2025-06-04T06:48:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Apxea](https://avatars.discourse-cdn.com/v4/letter/a/ad7895/32.png) [@Apxea](https://forum.inductiveautomation.com/u/Apxea)\
**Post date:** [June 4, 2025, 6:48am UTC](https://forum.inductiveautomation.com/t/can-i-dynamically-input-data-into-a-udt-parameter-based-on-a-query-tag/106994/1 "2025-06-04T06:48:19Z")

</div>

Hi everyone,

I'm working on a project where I use UDT instances to represent machines (e.g., `Machine-1001`, `Machine-1002`, etc.).  
Each UDT has a parameter like `machine_no` that I use to drive indirect tag paths or bindings inside the UDT.

I also have a `Query Tag` (executing every second) that returns a dataset from a SQL database — this includes the machine number and some runtime values.

What I want to do is:

- Match each row’s `machine_no` to an existing UDT tag name (e.g., match `1001` to `Machine-1001`)
- Then **update the `machine_no` UDT parameter** of the matched instance from the query result

Example:

- Dataset returns: `machine_no = 1001`
- Match to tag: `[default]Factory/Machine-1001`
- Goal: Set `[default]Factory/Machine-1001`’s parameter `machine_no = 1001`

My questions:

- Is it possible to update a **UDT parameter** at runtime after the instance is created?
- If yes, is `system.tag.configure()` the correct way?

Thanks in advance — any tips are welcome!

---

<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:** [June 4, 2025, 11:45am UTC](https://forum.inductiveautomation.com/t/can-i-dynamically-input-data-into-a-udt-parameter-based-on-a-query-tag/106994/2 "2025-06-04T11:45:28Z")

</div>

Yes, you **can** , with a tag change event script that monitors your query tag. But you **shouldn't** , as changing UDT instance parameters **restarts** the whole UDT, an expensive dynamic operation.

> [@Apxea](#):
>
> that I use to drive indirect tag paths or bindings inside the UDT.

Yeah, don't do this dynamically. Make one UDT instance per machine. Do any other indirection in your user interface, not in your tag architecture.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [June 4, 2025, 2:32pm UTC](https://forum.inductiveautomation.com/t/can-i-dynamically-input-data-into-a-udt-parameter-based-on-a-query-tag/106994/3 "2025-06-04T14:32:13Z")

</div>

Another major issue is that any tag and alarm history will be destroyed because their context will be missing..

---

<div class="post-metadata">

**Author:** ![Apxea](https://avatars.discourse-cdn.com/v4/letter/a/ad7895/32.png) [@Apxea](https://forum.inductiveautomation.com/u/Apxea)\
**Post date:** [June 6, 2025, 2:46am UTC](https://forum.inductiveautomation.com/t/can-i-dynamically-input-data-into-a-udt-parameter-based-on-a-query-tag/106994/4 "2025-06-06T02:46:12Z")

</div>

Thanks for the answers.  
I decided to go with a different method since changing UDT parameters dynamically isn’t recommended.  
I solved it by creating a dataset-type memory tag inside the UDT and writing the corresponding row of data into it using a script. Then, I used reference bindings to point to the dataset values.  
No need to change UDT parameters or recreate instances.  
It works well and keeps the structure stable.
