# Data in a table from Database

**URL:** <https://forum.inductiveautomation.com/t/data-in-a-table-from-database/73788>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [May 16, 2023, 2:35pm UTC](https://forum.inductiveautomation.com/t/data-in-a-table-from-database/73788 "2023-05-16T14:35:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luna](https://avatars.discourse-cdn.com/v4/letter/l/9fc348/32.png) [@Luna](https://forum.inductiveautomation.com/u/Luna)\
**Post date:** [May 16, 2023, 2:35pm UTC](https://forum.inductiveautomation.com/t/data-in-a-table-from-database/73788/1 "2023-05-16T14:35:31Z")

</div>

Hello community,

I'm working on a project in Perspective, and I'm having trouble loading data into a table from a database query. I currently have the Query created, but when I call it from the Data section of the Table, it returns an Error Configuration message.  
Does anyone have any idea why this is happening or how to solve it?

---

<div class="post-metadata">

**Author:** ![YF129701](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/yf129701/32/60498_2.png) [@YF129701](https://forum.inductiveautomation.com/u/YF129701)\
**Post date:** [May 16, 2023, 2:43pm UTC](https://forum.inductiveautomation.com/t/data-in-a-table-from-database/73788/2 "2023-05-16T14:43:11Z")

</div>

Can you attach a screenshot of what you're doing? Is the database connection valid (e.g. are you able to run the same query from Tools -\> Database Query Browser)?

---

<div class="post-metadata">

**Author:** ![Luna](https://avatars.discourse-cdn.com/v4/letter/l/9fc348/32.png) [@Luna](https://forum.inductiveautomation.com/u/Luna)\
**Post date:** [May 16, 2023, 4:50pm UTC](https://forum.inductiveautomation.com/t/data-in-a-table-from-database/73788/3 "2023-05-16T16:50:40Z")

</div>

Of course! The database connection is valid. I was able to run the same query from Tools -\> Database Query Browser, and it returned correct values. The issue arises when trying to assign those values to the rows and columns of the table.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/c/ec577d054c0d010e8874b58db2c1b3d30943b32e.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/c/4cc97639ab3d906dc2b1746b238fd8728f871c45.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/d/ad784b0bf33f25ff78a7592ea306d353a399d297.png)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [May 16, 2023, 5:07pm UTC](https://forum.inductiveautomation.com/t/data-in-a-table-from-database/73788/4 "2023-05-16T17:07:49Z")

</div>

Hover over 'Error Configuration' and see the tooltip.

Also, show us your script transform and any other transforms you have.

---

<div class="post-metadata">

**Author:** ![Luna](https://avatars.discourse-cdn.com/v4/letter/l/9fc348/32.png) [@Luna](https://forum.inductiveautomation.com/u/Luna)\
**Post date:** [May 16, 2023, 5:25pm UTC](https://forum.inductiveautomation.com/t/data-in-a-table-from-database/73788/5 "2023-05-16T17:25:02Z")

</div>

Thanks! This is the script I use in the transformation:

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

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 16, 2023, 5:56pm UTC](https://forum.inductiveautomation.com/t/data-in-a-table-from-database/73788/6 "2023-05-16T17:56:56Z")

</div>

You forgot to report on the Query Error\_Configuration tooltip. What does it say?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [May 16, 2023, 8:04pm UTC](https://forum.inductiveautomation.com/t/data-in-a-table-from-database/73788/7 "2023-05-16T20:04:45Z")

</div>

It's going to be line 3. `system.db()` doesn't need to be instantiated like a class. It's a static namespace. If you _really_ want to save typing `system.` repeatedly, you can change line 3 to just `db = system.db`. I would recommend against it, though. Community style has pretty much settled on not doing that, so it'll be confusing for anyone else used to Ignition who is reading your code in months or years.
