# Button to change Power Table

**URL:** <https://forum.inductiveautomation.com/t/button-to-change-power-table/88160>\
**Category:** Ignition\
**Tags:** ignition79, perspective, scripting\
**Created:** [April 1, 2024, 4:40pm UTC](https://forum.inductiveautomation.com/t/button-to-change-power-table/88160 "2024-04-01T16:40:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mia\_Galatis](https://avatars.discourse-cdn.com/v4/letter/m/f14d63/32.png) [@Mia\_Galatis](https://forum.inductiveautomation.com/u/Mia_Galatis)\
**Post date:** [April 1, 2024, 4:40pm UTC](https://forum.inductiveautomation.com/t/button-to-change-power-table/88160/1 "2024-04-01T16:40:54Z")

</div>

I have multiple buttons and I want it top change the data in a Power Table. My approach was to do the following scripting for each button but nothing is appearing in my power table.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/d/4d1308018bec5c02bb2b9e4b7641d913919000d0.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/a/aa328c848fa4c40f9bef3708f0d02d6174bb7607.png)

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [April 1, 2024, 4:47pm UTC](https://forum.inductiveautomation.com/t/button-to-change-power-table/88160/2 "2024-04-01T16:47:32Z")

</div>

System.db.runQuery() returns a PyDataSet type. You will need to convert to a basic dataset to use with the table

```python
event.source.parent.getComponent('Power Table 1').data = system.dataset.toDataSet(results)

```

---

<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:** [April 1, 2024, 4:48pm UTC](https://forum.inductiveautomation.com/t/button-to-change-power-table/88160/3 "2024-04-01T16:48:28Z")

</div>

Note: You only need to do that unwrapping in 7.9. In 8.1 PyDatasets _are_ Datasets.

---

<div class="post-metadata">

**Author:** ![Mia\_Galatis](https://avatars.discourse-cdn.com/v4/letter/m/f14d63/32.png) [@Mia\_Galatis](https://forum.inductiveautomation.com/u/Mia_Galatis)\
**Post date:** [April 1, 2024, 9:24pm UTC](https://forum.inductiveautomation.com/t/button-to-change-power-table/88160/4 "2024-04-01T21:24:29Z")

</div>

Still nothing is being displayed in my power table.
