# Display the number of tag folders

**URL:** <https://forum.inductiveautomation.com/t/display-the-number-of-tag-folders/73512>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [May 10, 2023, 8:15am UTC](https://forum.inductiveautomation.com/t/display-the-number-of-tag-folders/73512 "2023-05-10T08:15:35Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![KIM\_SUNG\_HOO](https://avatars.discourse-cdn.com/v4/letter/k/977dab/32.png) [@KIM\_SUNG\_HOO](https://forum.inductiveautomation.com/u/KIM_SUNG_HOO)\
**Post date:** [May 10, 2023, 8:15am UTC](https://forum.inductiveautomation.com/t/display-the-number-of-tag-folders/73512/1 "2023-05-10T08:15:35Z")

</div>

hi.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/0/70c7313b54b96bd46faed50b3047ec26a84c09f1.png)

I would like to generate the whole number in the database like the picture above. However, I currently generate available numbers but not full numbers.

The way I used it was to sum the numbers in {database.available} using expressions.

How to generate a whole number?

I thought I could just add the number of database/\* folders in the system tag. But failed to implement it.

---

<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:** [May 10, 2023, 8:36am UTC](https://forum.inductiveautomation.com/t/display-the-number-of-tag-folders/73512/2 "2023-05-10T08:36:54Z")

</div>

You're showing a screenshot of the number of databases and the number connected, but you're asking how to display the number of "tag folders"? These are completely unrelated to each other; can you explain exactly what you're after?

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [May 10, 2023, 9:01am UTC](https://forum.inductiveautomation.com/t/display-the-number-of-tag-folders/73512/3 "2023-05-10T09:01:41Z")

</div>

I think he's talking about tag folders because he wanted the number of folders in the `[system]Gateway/Database` folder.  
Classic x/y problem.

use this instead:

```python
system.db.getConnections().getRowCount()

```

---

<div class="post-metadata">

**Author:** ![KIM\_SUNG\_HOO](https://avatars.discourse-cdn.com/v4/letter/k/977dab/32.png) [@KIM\_SUNG\_HOO](https://forum.inductiveautomation.com/u/KIM_SUNG_HOO)\
**Post date:** [May 10, 2023, 11:45pm UTC](https://forum.inductiveautomation.com/t/display-the-number-of-tag-folders/73512/4 "2023-05-10T23:45:04Z")

</div>

> [@nminchin](#):
>
> You're showing a screenshot of the number of databases and the number connected

correct. i want to show the number of databases.

However, since I don't know how to do it, I wondered if it would be okay to do it with the number of tag folders.

---

<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:** [May 10, 2023, 11:47pm UTC](https://forum.inductiveautomation.com/t/display-the-number-of-tag-folders/73512/5 "2023-05-10T23:47:32Z")

</div>

It's sometimes better to ask how to achieve an end goal, rather than try to ask how to do something specific without giving any context. It leads to better understanding from our perspective, and usually better outcomes for you since we know what you're trying to do, and possibly if you're coming at it from the wrong direction

---

<div class="post-metadata">

**Author:** ![KIM\_SUNG\_HOO](https://avatars.discourse-cdn.com/v4/letter/k/977dab/32.png) [@KIM\_SUNG\_HOO](https://forum.inductiveautomation.com/u/KIM_SUNG_HOO)\
**Post date:** [May 10, 2023, 11:53pm UTC](https://forum.inductiveautomation.com/t/display-the-number-of-tag-folders/73512/6 "2023-05-10T23:53:55Z")

</div>

> [@pascal.fragnoud](#):
>
> `system.db.getConnections().getRowCount()`

Where should I use this? This cannot be used in expressions.

---

<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:** [May 11, 2023, 12:39am UTC](https://forum.inductiveautomation.com/t/display-the-number-of-tag-folders/73512/7 "2023-05-11T00:39:32Z")

</div>

It's python code, so no, it won't work in the expression language. You'll need to add it into a script transform if you want to run it from a client.

1. Create an expression binding, put `1` into the expression (we don't care about the expression)
2. Add a Script Transform
3. Add `return system.db.getConnections().getRowCount()`

---

<div class="post-metadata">

**Author:** ![KIM\_SUNG\_HOO](https://avatars.discourse-cdn.com/v4/letter/k/977dab/32.png) [@KIM\_SUNG\_HOO](https://forum.inductiveautomation.com/u/KIM_SUNG_HOO)\
**Post date:** [May 11, 2023, 1:03am UTC](https://forum.inductiveautomation.com/t/display-the-number-of-tag-folders/73512/8 "2023-05-11T01:03:54Z")

</div>

It works very well!

---

<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:** [May 11, 2023, 1:05am UTC](https://forum.inductiveautomation.com/t/display-the-number-of-tag-folders/73512/9 "2023-05-11T01:05:26Z")

</div>

Great, but you should give the solution to @pascal.fragnoud as he provided the contents of the solution 🙂
