# How to determine if a template is used in a project?

**URL:** <https://forum.inductiveautomation.com/t/how-to-determine-if-a-template-is-used-in-a-project/84748>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [January 25, 2024, 1:39am UTC](https://forum.inductiveautomation.com/t/how-to-determine-if-a-template-is-used-in-a-project/84748 "2024-01-25T01:39:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hamish\_Dodd](https://avatars.discourse-cdn.com/v4/letter/h/73ab20/32.png) [@Hamish\_Dodd](https://forum.inductiveautomation.com/u/Hamish_Dodd)\
**Post date:** [January 25, 2024, 1:39am UTC](https://forum.inductiveautomation.com/t/how-to-determine-if-a-template-is-used-in-a-project/84748/1 "2024-01-25T01:39:00Z")

</div>

I'm working on some projects that are replacing older ones. They have inherited many parts of these older projects, including some templates that are going unused.

I would like to determine which templates are not used anywhere within a project, so that I can delete them, preventing further confusion and excess storage.

I don't seem to be able to accomplish this with the Edit/Find and Replace tool, nor by the action menu of the templates themselves.

If anyone knows a way to accomplish this please do let me know, thanks!

---

<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:** [January 25, 2024, 4:36am UTC](https://forum.inductiveautomation.com/t/how-to-determine-if-a-template-is-used-in-a-project/84748/2 "2024-01-25T04:36:30Z")

</div>

This is an awesome question. In the find/replace tool, I haven't been able to get the search all windows option to work. It only works with windows that are opened.

To further complicate things, with templates, there's no easy way to know if they exist as a stand alone component in a window, or if they are being rendered by a template repeater or a template canvas. Furthermore, templates can also be nested in other templates.

I don't imagine there will be simple solution to this.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 25, 2024, 12:37pm UTC](https://forum.inductiveautomation.com/t/how-to-determine-if-a-template-is-used-in-a-project/84748/3 "2024-01-25T12:37:08Z")

</div>

Consider using a script module to collect template startup events (propertyChange on `componentRunning` on the template's root container) in a module-level cache, and when new ones arrive, report them to the gateway. Where a global usage cache could be kept.

---

<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:** [January 25, 2024, 4:27pm UTC](https://forum.inductiveautomation.com/t/how-to-determine-if-a-template-is-used-in-a-project/84748/4 "2024-01-25T16:27:55Z")

</div>

Basically the same question was asked here w.r.t Perspective:

> [@How to tell is component is used/referred to](https://forum.inductiveautomation.com/t/how-to-tell-is-component-is-used-referred-to/84661):
>
> i'm cleaning up a couple of projects and i was wondering if there is a way to tell if a particular view/component is referenced or used anywhere in the project? there's a LOT of dev-debris in these projects; unnamed components/views, &c. and they are being used in production (don't even get me started...) so i can't just delete willy-nilly. items that are in use need to be carefully renamed and scripts updated, &c. so i'm wondering if there's something to help me decide what's dross and what'…

And the answer is much the same. Collect usage statistics "manually" (see Phil's advice) if you want a well informed _guess_ at whether something is truly used.
