# Dynamically add values in table, from the tags?

**URL:** <https://forum.inductiveautomation.com/t/dynamically-add-values-in-table-from-the-tags/64292>\
**Category:** Ignition\
**Tags:** namedqueries, ignition80, database, scripting\
**Created:** [September 20, 2022, 4:34pm UTC](https://forum.inductiveautomation.com/t/dynamically-add-values-in-table-from-the-tags/64292 "2022-09-20T16:34:28Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raj\_Bhatt](https://avatars.discourse-cdn.com/v4/letter/r/a183cd/32.png) [@Raj\_Bhatt](https://forum.inductiveautomation.com/u/Raj_Bhatt)\
**Post date:** [September 20, 2022, 4:34pm UTC](https://forum.inductiveautomation.com/t/dynamically-add-values-in-table-from-the-tags/64292/1 "2022-09-20T16:34:28Z")

</div>

![DynamicallyAdd](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/e/5ebace1ce96a6a1231bd6f4c9793291795c5ce2c.png)

Hello How can i add the Delieverydate value into the Database? is there a scripting needs to be done on UDT? and i have set the “DelieveryDate” datatype to be “TEXT” in the query, please correct me on that too, if that is wrong, i tried to use “STRING” but did not like it.

Thanks

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [September 20, 2022, 4:36pm UTC](https://forum.inductiveautomation.com/t/dynamically-add-values-in-table-from-the-tags/64292/2 "2022-09-20T16:36:51Z")

</div>

Where’s your insert statement that is populating your `joblist` table? That is what needs to include the value of your DeliveryDate tag.

---

<div class="post-metadata">

**Author:** ![Raj\_Bhatt](https://avatars.discourse-cdn.com/v4/letter/r/a183cd/32.png) [@Raj\_Bhatt](https://forum.inductiveautomation.com/u/Raj_Bhatt)\
**Post date:** [September 20, 2022, 4:45pm UTC](https://forum.inductiveautomation.com/t/dynamically-add-values-in-table-from-the-tags/64292/3 "2022-09-20T16:45:36Z")

</div>

> [@bkarabinchak.psi](#):
>
> ting your `joblist` table?

Hello, i am not sure about the insert statement, but i believe this query is populating my current table.

 ![AskIgnition-2](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/0/80b9516399567979d5aec38a568c17d426ea0d68.png)

---

<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:** [September 20, 2022, 5:18pm UTC](https://forum.inductiveautomation.com/t/dynamically-add-values-in-table-from-the-tags/64292/4 "2022-09-20T17:18:05Z")

</div>

No, somewhere else there is a query which is inserting data in to the database. That query would need to include your delivery date, this could potentially be in a third party software.

In other words, where do the jobs in the joblist table come from?

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [September 20, 2022, 5:22pm UTC](https://forum.inductiveautomation.com/t/dynamically-add-values-in-table-from-the-tags/64292/5 "2022-09-20T17:22:19Z")

</div>

Might be helpful to do a Control+F to search your project, and look for `INSERT INTO joblist` to see if it appears in any scripting somewhere.

---

<div class="post-metadata">

**Author:** ![Raj\_Bhatt](https://avatars.discourse-cdn.com/v4/letter/r/a183cd/32.png) [@Raj\_Bhatt](https://forum.inductiveautomation.com/u/Raj_Bhatt)\
**Post date:** [September 20, 2022, 5:23pm UTC](https://forum.inductiveautomation.com/t/dynamically-add-values-in-table-from-the-tags/64292/6 "2022-09-20T17:23:46Z")

</div>

![AskIgnition-3](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/3/b357dc53203555c539e67755d3e4500411ae4657.png)

I found this thing, not sure if that is making that work or not? i added deliverydate too not sure still  
if i am on the right track

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [September 20, 2022, 5:28pm UTC](https://forum.inductiveautomation.com/t/dynamically-add-values-in-table-from-the-tags/64292/7 "2022-09-20T17:28:03Z")

</div>

Couple of things here. I see you did add `"DeliveryDate": deliveryDate` to the parameters and that is necessary, but is there a part above that where you define the variable `deliveryDate`? You will need to do that. Something like `delieryDate = system.tag.readBlocking(['path/to/your/deliveryDate'])[0].value` - this is what will grab the tag value.

After you do this - go over to the named query called `addJob`.

There, add a parameter called `DeliveryDate` - it must match exactly what you called the key in your parameter dictionary (your params variable), case sensitive, so just copy and paste or double check yourself. Set it to a datetime type of parameter (assuming you are using a datetime column type in your database which you should if you are not for dates), and then you will have to add the column/parameter to your actual insert statement to now insert this parameter into that column.

---

<div class="post-metadata">

**Author:** ![Raj\_Bhatt](https://avatars.discourse-cdn.com/v4/letter/r/a183cd/32.png) [@Raj\_Bhatt](https://forum.inductiveautomation.com/u/Raj_Bhatt)\
**Post date:** [September 21, 2022, 3:07pm UTC](https://forum.inductiveautomation.com/t/dynamically-add-values-in-table-from-the-tags/64292/8 "2022-09-21T15:07:10Z")

</div>

![AskIgnition-4](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/b/2bf45efb385ed711163ccede1b281112b0e8dbd2.png)

Hello i followed the procedure that you recommended, it works fine for when adding new job with button control however, it does not effect the data that has been previously entered. I added deliveryDate column just recently but that data (job# & delieverydate on UDT) was already there. How can i update delieverydate Column in table to its corresponding UDT?

Thank you

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [September 21, 2022, 3:17pm UTC](https://forum.inductiveautomation.com/t/dynamically-add-values-in-table-from-the-tags/64292/9 "2022-09-21T15:17:38Z")

</div>

The simplest solution might be to run a one time script. You can probably even do this from the script console.

I can’t write the script right now, but if you know python it shouldn’t be too hard:

1. use ‘system.tag.browse’ to find UDTs that correspond to jobs
2. read the DeliveryDate
3. use the instance name to find which row to update in the table
4. use `update {table} set {delivery column name} = deliveryDate where jobnumber = {instance name}`

This should be enough.

---

<div class="post-metadata">

**Author:** ![Raj\_Bhatt](https://avatars.discourse-cdn.com/v4/letter/r/a183cd/32.png) [@Raj\_Bhatt](https://forum.inductiveautomation.com/u/Raj_Bhatt)\
**Post date:** [September 21, 2022, 3:28pm UTC](https://forum.inductiveautomation.com/t/dynamically-add-values-in-table-from-the-tags/64292/10 "2022-09-21T15:28:50Z")

</div>

hello, thank you for response.

i am not sure where to use system.tag.browse and how can i have my system.tag.browse to dynamically see the UDT and read deliverydate. Do i have to create another query inside my Named queries to do this update or somewhere else?

Thanks
