# List all tags used in a page

**URL:** <https://forum.inductiveautomation.com/t/list-all-tags-used-in-a-page/24253>\
**Category:** Ignition\
**Created:** [April 19, 2019, 9:39am UTC](https://forum.inductiveautomation.com/t/list-all-tags-used-in-a-page/24253 "2019-04-19T09:39:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lettierf](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lettierf/32/7431_2.png) [@lettierf](https://forum.inductiveautomation.com/u/lettierf)\
**Post date:** [April 19, 2019, 9:39am UTC](https://forum.inductiveautomation.com/t/list-all-tags-used-in-a-page/24253/1 "2019-04-19T09:39:20Z")

</div>

Hi all  
I am trying to get all tags used in a page. At now I am able to it by listing all the components in a page and then get the property of the linked tag. This is working quite fine because the objects in a page are iterable and it almost always possible to get the children of each component. The problems comes when one of the object is a template holder because I am not able to list its children. Is there a way to do that?As an alternative is it possible to open a template like we open a page? As an alternative of the alternative (😀) is it possible (maybe in runtime) to get the tags used in a page ? I think that something like that should be possible , otherwise the system will never know what are the leased tags to handle with the fast or slow scan

---

<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:** [April 19, 2019, 3:11pm UTC](https://forum.inductiveautomation.com/t/list-all-tags-used-in-a-page/24253/2 "2019-04-19T15:11:17Z")

</div>

Bindings are stored in the window’s [InteractionController](http://files.inductiveautomation.com/sdk/javadoc/ignition79/795/com/inductiveautomation/factorypmi/application/binding/InteractionController.html). Digging around in there is very much unsupported…

---

<div class="post-metadata">

**Author:** ![lettierf](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lettierf/32/7431_2.png) [@lettierf](https://forum.inductiveautomation.com/u/lettierf)\
**Post date:** [April 24, 2019, 6:22am UTC](https://forum.inductiveautomation.com/t/list-all-tags-used-in-a-page/24253/3 "2019-04-24T06:22:32Z")

</div>

Thank you . Theoretically it would be the best follow the InteractionController but the lack of documentation on it make that way quite hard. At now I am able to do it by :  
1)

- listing all the components in a window (looping with rootContainer.getComponent(currentComponentIndex)
- if I found I template of templates I extract all the component by using this piece of code found on the forum

```auto
def getTemplateResourceType():
	"""Resource type string."""
	return 'component-template'

def getTemplateFilter():
	"""Filter throw away for template types."""
	return lambda x: bool(x.getResourceType() == getTemplateResourceType())

def getContext(event):
	"""Context."""
	return event.source.parent.getAppContext()

def getProjectReference(event):
	"""Project reference."""
	return getContext(event).getProject()

def getTemplateInstance(event, templatePath):
	"""
	Return Template Instance. 
	Pass the path into here.
	"""
	context = getContext(event)
	project_obj = context.getProject()
	templateManager = context.getTemplateManager()
	templateId = templateManager.getId(templatePath)
	return templateManager.getTemplateInstance(templateId)

```

The only problem is the following. Each template has a custom property called tagPath (that contains of course the path to the tag in a string format). If I call the component.tagPath on a component that is on the main window I get it correctly. If I call it on a component that is a child of templateManager.getTemplateInstance it’s not working. It allow me to list all the standard templates’ properties (name,visible, border) but not the custom one “tagPath”. This sound quite strange to me and I am still fighting to figure it out

---

<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:** [April 24, 2019, 10:29am UTC](https://forum.inductiveautomation.com/t/list-all-tags-used-in-a-page/24253/4 "2019-04-24T10:29:06Z")

</div>

> [@lettierf](#):
>
> It allow me to list all the standard templates’ properties (name,visible, border) but not the custom one “tagPath”. This sound quite strange to me and I am still fighting to figure it out

This is due to a limitation of the methods used by Ignition to wrap (java) components for use in jython. A technical discussion of this phenomenon is here:

> [@Transaction groups triggered expression item updating when trigger is false](http://forum.inductiveautomation.com/t/transaction-groups-triggered-expression-item-updating-when-trigger-is-false/17196/14):
>
> Ok, so I’ve been down the rabbit hole and found Ignition’s (undocumented) PyComponentWrapper. I haven’t deciphered it enough to be sure, but it seems to be invoked only for particular situations, based on the string constants in the class file (like “getComponent” and “getComponents”). To play with this, I constructed a conversion adapter like so: public class PyComponentAdapter implements PyObjectAdapter { public PyComponentAdapter() {} @Override public boolean canAdapt(Object jObj) { …

TL/DR: Install my [Simulation Aids](https://inductiveautomation.com/moduleshowcase/module/automation-professionals-llc-simulation-aids) module to fix the PyComponentWrapper.
