# Can you get the amount of tags tied to a tag group?

**URL:** <https://forum.inductiveautomation.com/t/can-you-get-the-amount-of-tags-tied-to-a-tag-group/81008>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [October 26, 2023, 6:41am UTC](https://forum.inductiveautomation.com/t/can-you-get-the-amount-of-tags-tied-to-a-tag-group/81008 "2023-10-26T06:41:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Esn](https://avatars.discourse-cdn.com/v4/letter/e/91b2a8/32.png) [@Esn](https://forum.inductiveautomation.com/u/Esn)\
**Post date:** [October 26, 2023, 6:41am UTC](https://forum.inductiveautomation.com/t/can-you-get-the-amount-of-tags-tied-to-a-tag-group/81008/1 "2023-10-26T06:41:59Z")

</div>

Hi,

As the title says can you somehow see how many tags is connected to a tag group?

I know I could browse all my tags and count the amount of tags in each tag group, but I was hoping for a more readily available method.

Thanks

---

<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:** [October 26, 2023, 11:55am UTC](https://forum.inductiveautomation.com/t/can-you-get-the-amount-of-tags-tied-to-a-tag-group/81008/2 "2023-10-26T11:55:46Z")

</div>

The tag report tool should be able to do this.

---

<div class="post-metadata">

**Author:** ![joshdunstan](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/joshdunstan/32/43306_2.png) [@joshdunstan](https://forum.inductiveautomation.com/u/joshdunstan)\
**Post date:** [February 5, 2024, 6:48am UTC](https://forum.inductiveautomation.com/t/can-you-get-the-amount-of-tags-tied-to-a-tag-group/81008/3 "2024-02-05T06:48:13Z")

</div>

Hey Esn,

I was looking to do the same quickly to see where my bottlenecks are, see the below:

```auto
provider = ''
path = 'Modules/AnalogueInput/*'

query = {
  "options": {
    "includeUdtMembers": True,
    "includeUdtDefinitions": False
  },
  "condition": {
    "path": path,
    "tagType": "AtomicTag",
    "attributes": {
      "values": [],
      "requireAll": True
    }
  },
  "returnProperties": [
    "tagGroup"
  ]
}

results = system.tag.query(provider, query)

# If the tag group already exists, add one, if not, add to dict with a count of one
tagGroupCount = {}
for result in results:
	tagGroup = result['tagGroup']
	if tagGroup in tagGroupCount:
		tagGroupCount[tagGroup] += 1
	else:
		tagGroupCount[tagGroup] = 1
		
# Max string length for displaying neatly
max_length = max(len(result) for result in tagGroupCount)	

# Print the results
print "Tag Group" + " " * (max_length - 7) + "Count"
print "-" * (max_length + 12)
for tagGroup, count in tagGroupCount.items():
    print tagGroup + " " * (max_length - len(tagGroup) + 2) + str(count)

```

Gives a neat output:

```auto
Tag Group Count
-----------------------------
Parameters 1 2500
Alarm Detail 1 7000
Settings 1 500
State 1 750
Feedback 1 500
Inputs 1 250
Status 1 2250
Alarm Status 1 1750
Overrides 1250
Alarm Query Tag 1 10500
Detail 1 750
Requests 1 1750

```

No judging on the code. Thanks!

Josh
