# Ignition Tag Count in a project

**URL:** <https://forum.inductiveautomation.com/t/ignition-tag-count-in-a-project/78201>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [August 22, 2023, 7:08am UTC](https://forum.inductiveautomation.com/t/ignition-tag-count-in-a-project/78201 "2023-08-22T07:08:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pallavi\_N](https://avatars.discourse-cdn.com/v4/letter/p/7ab992/32.png) [@pallavi\_N](https://forum.inductiveautomation.com/u/pallavi_N)\
**Post date:** [August 22, 2023, 7:08am UTC](https://forum.inductiveautomation.com/t/ignition-tag-count-in-a-project/78201/1 "2023-08-22T07:08:54Z")

</div>

Is there any way to calculate total numbers of tags used in ignition project.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [August 22, 2023, 7:10am UTC](https://forum.inductiveautomation.com/t/ignition-tag-count-in-a-project/78201/2 "2023-08-22T07:10:23Z")

</div>

This will give you the total number of Ignition tags in a tag provider, and summarise them by different properties.  
Run this in the script console, preferably directly on the GW server.

```auto
"""
Produces a summary of tags.
Example output:

Tag summary
========================
tagType: {'UdtInstance': 43, 'Folder': 95, 'AtomicTag': 644}
valueSource: {'memory': 197, 'opc': 391, 'reference': 1, 'expr': 47, 'derived': 2, 'db': 6}
dataType: {'Float4': 2, 'Int2': 3, 'DataSet': 43, 'Float8': 18, 'Int4': 295, 'String': 32, 'Int8': 27, 'Document': 3, 'Boolean': 221}
tagGroup: {'Default': 741, 'Alarm Summary': 18, 'ConfigTags_CMDPLCReset': 7, 'Value Change Triggers': 16}
"""

def getProviders():
	providers = system.tag.browse('')
	targetProviders = []
	for provider in providers.getResults():
		targetProviders.append(provider['name'])
	
	return targetProviders

providers = getProviders()

for provider in providers:
	# list of tag properties to include in the summary. Must be valid tag properties
	tag_summary_properties = ['tagType', 'valueSource', 'dataType', 'tagGroup', 'eventScripts', 'historyEnabled']
	query = {
		"options": {
			"includeUdtMembers": True,
			"includeUdtDefinitions": False
		},
		"condition": {
			"attributes": {
				"values": [],
				"requireAll": True
			}
		},
		"returnProperties": tag_summary_properties
	}
	
	print ''
	print 'Tag summary for provider "{}"'.format(provider)
	print "======================================================="
	tags = system.tag.query(provider, query)
	for tag_summary_property in tag_summary_properties:
		tag_summary = {}
		for tag in tags:
			if tag_summary_property in tag:
				if tag_summary_property == 'eventScripts':
					if tag['eventScripts'] is not None and tag['eventScripts'][0].get('enabled', True):
						temp = tag_summary.setdefault('eventScripts', 0)
						tag_summary['eventScripts'] += 1
				else:
					temp = tag_summary.setdefault(str(tag[tag_summary_property]), 0)
					tag_summary[str(tag[tag_summary_property])] += 1
		print '{}: {}'.format(tag_summary_property, tag_summary)

```

If you do end up using this, I wouldn't mind knowing what it returns 🙂

---

<div class="post-metadata">

**Author:** ![sebastien\_ng](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sebastien_ng/32/55297_2.png) [@sebastien\_ng](https://forum.inductiveautomation.com/u/sebastien_ng)\
**Post date:** [August 22, 2023, 7:54am UTC](https://forum.inductiveautomation.com/t/ignition-tag-count-in-a-project/78201/3 "2023-08-22T07:54:24Z")

</div>

Hello, if it is only to show the number of tag used, you can go to the main status \> Overview page on the Ignition Gateway.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/3/33c00f9b1f189a78beb831e4649c90b754c45184.png)

---

<div class="post-metadata">

**Author:** ![pallavi\_N](https://avatars.discourse-cdn.com/v4/letter/p/7ab992/32.png) [@pallavi\_N](https://forum.inductiveautomation.com/u/pallavi_N)\
**Post date:** [August 22, 2023, 8:16am UTC](https://forum.inductiveautomation.com/t/ignition-tag-count-in-a-project/78201/4 "2023-08-22T08:16:51Z")

</div>

Hi nminchin,  
I used the gateway option to get total count,  
apologize i didn't use the script , thanks for the reply 🙂

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [August 22, 2023, 8:18am UTC](https://forum.inductiveautomation.com/t/ignition-tag-count-in-a-project/78201/5 "2023-08-22T08:18:14Z")

</div>

The gateway method counts folders, udt instances, and udt definitions tags as well, so it's not really a good count of tags in use
