# Template labels won't maintain text in the repeater

**URL:** <https://forum.inductiveautomation.com/t/template-labels-wont-maintain-text-in-the-repeater/12486>\
**Category:** Ignition\
**Created:** [December 20, 2016, 4:11pm UTC](https://forum.inductiveautomation.com/t/template-labels-wont-maintain-text-in-the-repeater/12486 "2016-12-20T16:11:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![erfritts](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/erfritts/32/3660_2.png) [@erfritts](https://forum.inductiveautomation.com/u/erfritts)\
**Post date:** [December 20, 2016, 4:11pm UTC](https://forum.inductiveautomation.com/t/template-labels-wont-maintain-text-in-the-repeater/12486/1 "2016-12-20T16:11:39Z")

</div>

I’ve been trying to get more cozy with the template capabilities of Ignition and a need arose that I thought would be perfect for the Template Repeater. I made a template of labels to be filled by a periodically changing dataset. Everything seems to be working except that all my labels disappear right after they are printed to the screen ![:scratch:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/76d1620bec252bfac07050c889ff5a91dc8a9c25.gif ":scratch:") . The template is just a collection of labels. Here is my script for the Template Repeater.

[code]s1c = event.source.parent.getComponent(“Schedule1Container”)  
schedule = system.tag.read("[Client]schedule1").value  
system.tag.write("[Client]schedule1count", schedule.rowCount)  
tlist = s1c.getLoadedTemplates()

for index,template in enumerate(tlist):   
template.getComponent(‘lblPartNumber’).text = schedule.data[0][index]  
template.getComponent(‘lblQtyScheduled’).text = schedule.data[2][index]  
template.getComponent(‘lblNote’).text = "Note: " + schedule.data[3][index]  
[/code]

Thanks

---

<div class="post-metadata">

**Author:** ![erfritts](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/erfritts/32/3660_2.png) [@erfritts](https://forum.inductiveautomation.com/u/erfritts)\
**Post date:** [December 21, 2016, 2:07pm UTC](https://forum.inductiveautomation.com/t/template-labels-wont-maintain-text-in-the-repeater/12486/2 "2016-12-21T14:07:53Z")

</div>

So I finally gave in and called tech support last night. I’d like to thank Aaron for helping me figure out what I was doing wrong. ![:prayer:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/e5a7e3b63facc151ea73e3b45db7bdb3d4bdc316.gif ":prayer:") . I was using a dataset tag to supply the data for my templates and I wanted to insure I did not run into an index out of bounds error by writing the datasets rowcount to the template repeaters repeat count. I created a race condition that made the templates reset. when Aaron commented out the line my code worked. I already have code to update and setup my datasets at the project level so Aaron suggested I simply bind my datasets to the Template Parameters of the repeater and use the Dataset repeat behavior instead of the count behavior. Dope! I went overkill on the scripts this works perfect. Project level script to fill the datasets and bind an d forget ![:thumb_left:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/e26afb081ddde6df016df6ee49159cf56aaca688.gif ":thumb\_left:")
