# How to get the number of vision clients to appear from a perspective

**URL:** <https://forum.inductiveautomation.com/t/how-to-get-the-number-of-vision-clients-to-appear-from-a-perspective/73704>\
**Category:** Ignition\
**Tags:** perspective, vision, ignition81\
**Created:** [May 15, 2023, 5:28am UTC](https://forum.inductiveautomation.com/t/how-to-get-the-number-of-vision-clients-to-appear-from-a-perspective/73704 "2023-05-15T05:28:05Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jiyoung\_hwang1](https://avatars.discourse-cdn.com/v4/letter/j/bc79bd/32.png) [@jiyoung\_hwang1](https://forum.inductiveautomation.com/u/jiyoung_hwang1)\
**Post date:** [May 15, 2023, 5:28am UTC](https://forum.inductiveautomation.com/t/how-to-get-the-number-of-vision-clients-to-appear-from-a-perspective/73704/1 "2023-05-15T05:28:05Z")

</div>

![1](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/e/aefa9f0e3207b038df0543171d66113d0d97575e.gif)

Hi.

Picture "1" shows the number of vision clients.

I would like to express this quantity from a perspective.

For your information

[https://docs.inductiveautomation.com/display/DOC81/System+Tags](https://docs.inductiveautomation.com/display/DOC81/System+Tags)

It's not on this site.

Please tell me how I can display the quantity.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [May 15, 2023, 11:20am UTC](https://forum.inductiveautomation.com/t/how-to-get-the-number-of-vision-clients-to-appear-from-a-perspective/73704/2 "2023-05-15T11:20:37Z")

</div>

Hard to believe that `[System]Gateway/Sessions/SessionCount` doesn't exist.

But, it can be done through scripting.

[https://docs.inductiveautomation.com/display/DOC81/system.util.getSessionInfo](https://docs.inductiveautomation.com/display/DOC81/system.util.getSessionInfo)

---

<div class="post-metadata">

**Author:** ![jiyoung\_hwang1](https://avatars.discourse-cdn.com/v4/letter/j/bc79bd/32.png) [@jiyoung\_hwang1](https://forum.inductiveautomation.com/u/jiyoung_hwang1)\
**Post date:** [May 15, 2023, 11:44pm UTC](https://forum.inductiveautomation.com/t/how-to-get-the-number-of-vision-clients-to-appear-from-a-perspective/73704/4 "2023-05-15T23:44:03Z")

</div>

I did it in the way you told me

I'd like to extract the yellow part of picture number 1 as a quantity, so please tell me how to do it.

 ![1](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/d/fd52c9b3ef7dc609a4ca6111ba4bd7f54ffcc948.gif)

---

<div class="post-metadata">

**Author:** ![Matthew.gaitan](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@Matthew.gaitan](https://forum.inductiveautomation.com/u/Matthew.gaitan)\
**Post date:** [May 16, 2023, 12:42am UTC](https://forum.inductiveautomation.com/t/how-to-get-the-number-of-vision-clients-to-appear-from-a-perspective/73704/5 "2023-05-16T00:42:37Z")

</div>

something along the lines of:

```auto
sessionInfo = system.util.getSessionInfo()
clientCount = len([x for x in sessionInfo if not x['isDesigner']])

```

---

<div class="post-metadata">

**Author:** ![jiyoung\_hwang1](https://avatars.discourse-cdn.com/v4/letter/j/bc79bd/32.png) [@jiyoung\_hwang1](https://forum.inductiveautomation.com/u/jiyoung_hwang1)\
**Post date:** [May 16, 2023, 12:47am UTC](https://forum.inductiveautomation.com/t/how-to-get-the-number-of-vision-clients-to-appear-from-a-perspective/73704/7 "2023-05-16T00:47:56Z")

</div>

![1](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/c/2c16e073a18edafc1c7305b10aa9bdbee432a290.gif)  
The value is null.

---

<div class="post-metadata">

**Author:** ![Matthew.gaitan](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@Matthew.gaitan](https://forum.inductiveautomation.com/u/Matthew.gaitan)\
**Post date:** [May 16, 2023, 1:08am UTC](https://forum.inductiveautomation.com/t/how-to-get-the-number-of-vision-clients-to-appear-from-a-perspective/73704/8 "2023-05-16T01:08:46Z")

</div>

You need to return the result

Change it to

```auto
sessionInfo = system.util.getSessionInfo()
return len([x for x in sessionInfo if not x['isDesigner']])

```

---

<div class="post-metadata">

**Author:** ![jiyoung\_hwang1](https://avatars.discourse-cdn.com/v4/letter/j/bc79bd/32.png) [@jiyoung\_hwang1](https://forum.inductiveautomation.com/u/jiyoung_hwang1)\
**Post date:** [May 16, 2023, 1:18am UTC](https://forum.inductiveautomation.com/t/how-to-get-the-number-of-vision-clients-to-appear-from-a-perspective/73704/10 "2023-05-16T01:18:48Z")

</div>

It was solved by doing it the way you told me.

Why did you put the "x" in front of "for" in the method

"return len([x for x in session Info if not x ['isDesigner'])" ?

---

<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:** [May 16, 2023, 1:53am UTC](https://forum.inductiveautomation.com/t/how-to-get-the-number-of-vision-clients-to-appear-from-a-perspective/73704/11 "2023-05-16T01:53:42Z")

</div>

> [@jiyoung\_hwang1](#):
>
> Why did you put the "x" in front of "for"

This is an example of [list comprehension](https://www.w3schools.com/python/python_lists_comprehension.asp). The x is merely a generic variable name.
