# Multiple rows on power table

**URL:** <https://forum.inductiveautomation.com/t/multiple-rows-on-power-table/40110>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [October 28, 2020, 6:05pm UTC](https://forum.inductiveautomation.com/t/multiple-rows-on-power-table/40110 "2020-10-28T18:05:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrewcorks](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@andrewcorks](https://forum.inductiveautomation.com/u/andrewcorks)\
**Post date:** [October 28, 2020, 6:05pm UTC](https://forum.inductiveautomation.com/t/multiple-rows-on-power-table/40110/1 "2020-10-28T18:05:25Z")

</div>

Disclaimer: New Ignition User  
I’ve created a historical transaction group for multiple values from my PLC and have a trigger. I am trying to create a power table that lists all the values when there is a trigger event, with multiple rows show the last 5 historical values recorded on trigger events.

Where I’m at:  
My Power Table will only list the row I select using the DB Browse\>Generated SELECT Query, and won’t update.

Example:  
SELECT RunEfficency, Total\_panels\_per\_ShiftOrRun, VolumeSumof38, t\_stamp, ProdStr FROM mdo\_report WHERE mdo\_report\_ndx = 8

---

<div class="post-metadata">

**Author:** ![schenk](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@schenk](https://forum.inductiveautomation.com/u/schenk)\
**Post date:** [October 28, 2020, 11:10pm UTC](https://forum.inductiveautomation.com/t/multiple-rows-on-power-table/40110/2 "2020-10-28T23:10:36Z")

</div>

Try changing your binding type to SQL Query or Named Query and do something like this

```auto
SELECT TOP 5
	RunEfficency,
	Total_panels_per_ShiftOrRun,
	VolumeSumof38,
	t_stamp,
	ProdStr
FROM 
	mdo_report 
ORDER BY
	t_stamp DESC

```

As far as refreshing the table goes, you could use the polling rate on the binding, but I prefer to create a custom property and use a property change script to run the update on demand.

1. Create a custom property on the root container named ‘trigger’
2. Bind the property value to the same tag you use to trigger the transaction group
3. Place the following code in a property change event script on the root container

```auto
if event.propertyName == 'trigger':
	if not event.source.trigger:
		table = event.source.parent.getComponent('Power Table')
		system.db.refresh(table, 'data')

```

---

<div class="post-metadata">

**Author:** ![andrewcorks](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@andrewcorks](https://forum.inductiveautomation.com/u/andrewcorks)\
**Post date:** [October 29, 2020, 4:33pm UTC](https://forum.inductiveautomation.com/t/multiple-rows-on-power-table/40110/3 "2020-10-29T16:33:37Z")

</div>

Great! I’ll try this out, thanks!
