# Accessing components inside a template repeater

**URL:** <https://forum.inductiveautomation.com/t/accessing-components-inside-a-template-repeater/26564>\
**Category:** Ignition\
**Created:** [July 15, 2019, 8:19pm UTC](https://forum.inductiveautomation.com/t/accessing-components-inside-a-template-repeater/26564 "2019-07-15T20:19:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dtr019](https://avatars.discourse-cdn.com/v4/letter/d/5f9b8f/32.png) [@dtr019](https://forum.inductiveautomation.com/u/dtr019)\
**Post date:** [July 15, 2019, 8:19pm UTC](https://forum.inductiveautomation.com/t/accessing-components-inside-a-template-repeater/26564/1 "2019-07-15T20:19:38Z")

</div>

Hi, I am using a template repeater to display one of my longer main windows (as it gives me scroll bars instead of resizing my components) but now I am having trouble accessing the power table component inside the template repeater. I looked on the forum and found an old post.  
[http://forum.inductiveautomation.com/t/getting-a-value-from-a-template-in-a-template-repeater/10128/6](http://forum.inductiveautomation.com/t/getting-a-value-from-a-template-in-a-template-repeater/10128/6)  
It suggested following:

```auto
templateRepeater = event.source.parent.getComponent('Template Repeater')
templates = templateRepeater.getLoadedTemplates()
template = templates[0]
power_table = template.getComponent('Power Table')

```

But now I am getting this error, “IndexError: index out of range: 0”

I am still a newbie, any kind of help is appreciated, Thanks!!

---

<div class="post-metadata">

**Author:** ![gmiroclosa](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/gmiroclosa/32/21572_2.png) [@gmiroclosa](https://forum.inductiveautomation.com/u/gmiroclosa)\
**Post date:** [March 1, 2022, 2:54pm UTC](https://forum.inductiveautomation.com/t/accessing-components-inside-a-template-repeater/26564/2 "2022-03-01T14:54:50Z")

</div>

> [@dtr019](#):
>
> `getComponent`

Try not to use index; if you could get the Components directly from a FOR statement:  
for temp in templates:  
temp.getComponent....
