# Object has no attribute 'getLoadedTemplates'

**URL:** <https://forum.inductiveautomation.com/t/object-has-no-attribute-getloadedtemplates/72177>\
**Category:** Ignition\
**Tags:** vision, ignition81\
**Created:** [April 7, 2023, 7:08am UTC](https://forum.inductiveautomation.com/t/object-has-no-attribute-getloadedtemplates/72177 "2023-04-07T07:08:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lina\_Su](https://avatars.discourse-cdn.com/v4/letter/l/7ba0ec/32.png) [@Lina\_Su](https://forum.inductiveautomation.com/u/Lina_Su)\
**Post date:** [April 7, 2023, 7:08am UTC](https://forum.inductiveautomation.com/t/object-has-no-attribute-getloadedtemplates/72177/1 "2023-04-07T07:08:50Z")

</div>

I'm encountering an issue when trying to access a component value within a Template Repeater in Ignition. To debug this, I have created a simple test screen based on the example code provided in the user manual. My goal is to display the text of a Label component inside the Template Repeater as a message when the button is clicked. However, I keep encountering errors when attempting to do this. Here's a screenshot of my test screen and the code I am using. Please note that I have ensured the component names match those in the example code. Can anyone provide assistance or guidance on how to resolve this issue?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/9/c9ae45d981b60da01df9900fcaac5984848169b9.png)

```auto
#This script will call getLoadedTemplates() on a Template Repeater, and
#then print the text property of a Label component in each instance
 
#Store a reference to the Template Repeater component in a variable
repeater = event.source.parent.getComponent('Template Repeater')
 
#Store the list of templates in another variable
templateList = repeater.getLoadedTemplates()
 
#Iterate through the list
for template in templateList:
    #find a component named "Label" in the instance,
    #and print the value of the text property 
    print template.getComponent('Label').text

```

error:

```auto
Traceback (most recent call last):
  File "<event:actionPerformed>", line 8, in <module>
AttributeError: 'com.inductiveautomation.factorypmi.application.com' object has no attribute 'getLoadedTemplates'

Ignition v8.1.21 (b2022092908)
Java: Azul Systems, Inc. 11.0.15

```

I also tried to change the getLoadedTemplates to getTemplateInstances , it does not work.

[Vision - Template Repeater - Ignition User Manual 8.1 - Ignition Documentation (inductiveautomation.com)](https://docs.inductiveautomation.com/display/DOC81/Vision+-+Template+Repeater)

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [April 7, 2023, 9:27am UTC](https://forum.inductiveautomation.com/t/object-has-no-attribute-getloadedtemplates/72177/2 "2023-04-07T09:27:24Z")

</div>

The object you are displaying is named _Template Repeater_, but your icon is actually that of a template itself, not an actual template repeater. Are you using a template with a template repeater inside of it? If so, you will need to modify your script, so it gets the template repeater from inside the template itself .

**Example:**

```auto
from com.inductiveautomation.factorypmi.application.components import TemplateRepeater
visionTemplate = event.source.parent.getComponent('Template Repeater').getComponent(0)
for component in visionTemplate.getComponents():
	if isinstance(component, TemplateRepeater):
		#template repeater code here
		break

```

**Template Icon:**  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/4/e44a342ceaadd99f6367001356afebba3a055c16.png)

**Template Repeater Icon:**  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/c/2c5314330764563e6912486c865cd1fca201bb54.png)
