# Get Perspective view path(s) from session PageIds?

**URL:** <https://forum.inductiveautomation.com/t/get-perspective-view-path-s-from-session-pageids/62988>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [August 15, 2022, 1:43am UTC](https://forum.inductiveautomation.com/t/get-perspective-view-path-s-from-session-pageids/62988 "2022-08-15T01:43:49Z")\
**Posts on this page:** 14\
**Page:** 1

<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 15, 2022, 1:43am UTC](https://forum.inductiveautomation.com/t/get-perspective-view-path-s-from-session-pageids/62988/1 "2022-08-15T01:43:49Z")

</div>

`system.perspective.getSessionInfo` returns the PageIds open on each session, but how can I get the view paths open using these?

Would I need to get a reference to the [InternalSession](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.19/com/inductiveautomation/perspective/gateway/session/InternalSession.html)?  
When I try to import this with

```auto
from com.inductiveautomation.perspective.gateway.session import InternalSession

```

I get an error:

```auto
Caused by: com.inductiveautomation.ignition.common.GenericTransferrableException: ImportError: No module named perspective

```

I’m calling this from a Perspective button

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [August 15, 2022, 2:26am UTC](https://forum.inductiveautomation.com/t/get-perspective-view-path-s-from-session-pageids/62988/2 "2022-08-15T02:26:18Z")

</div>

Curious how you get a list of open views regardless of page IDs.

---

<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 15, 2022, 2:27am UTC](https://forum.inductiveautomation.com/t/get-perspective-view-path-s-from-session-pageids/62988/3 "2022-08-15T02:27:00Z")

</div>

I think the process would be the same since views are opened by pages

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [August 15, 2022, 2:32am UTC](https://forum.inductiveautomation.com/t/get-perspective-view-path-s-from-session-pageids/62988/4 "2022-08-15T02:32:13Z")

</div>

I don’t think Pages have direct insight into the Views in use within, just like Embedded Views don’t have direct insight into the content of the residing View.

---

<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 15, 2022, 2:45am UTC](https://forum.inductiveautomation.com/t/get-perspective-view-path-s-from-session-pageids/62988/5 "2022-08-15T02:45:43Z")

</div>

This is really what i’m after which is available from the gateway status webpage under Perspective Sessions:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/0/506274d7c867dd9b273b7ca60ee651225ad0d024.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/e/ae79a842666c514d239c43c7703a67e9a0b028bb.png)

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [August 15, 2022, 2:51pm UTC](https://forum.inductiveautomation.com/t/get-perspective-view-path-s-from-session-pageids/62988/6 "2022-08-15T14:51:00Z")

</div>

Right, but the route for obtaining that information is not exposed as part of the available scripting options. What’s the use-case?

---

<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 15, 2022, 8:18pm UTC](https://forum.inductiveautomation.com/t/get-perspective-view-path-s-from-session-pageids/62988/7 "2022-08-15T20:18:00Z")

</div>

The use-case is to see exactly how many alarm status tables are being displayed, as we might be having issues with them. But aside from that, it’d also be useful as an analytic tool to see what views operators spend most of their time on

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [August 15, 2022, 9:21pm UTC](https://forum.inductiveautomation.com/t/get-perspective-view-path-s-from-session-pageids/62988/8 "2022-08-15T21:21:31Z")

</div>

Is there any reason you can’t just track this through a memory/diagnostic tag and increment/decrement the count of ASTs through a component onStartup/onShutdown write? It might not be 100% accurate, but I suspect it would be exactly as accurate as referencing views in open sessions.

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [August 16, 2022, 6:33am UTC](https://forum.inductiveautomation.com/t/get-perspective-view-path-s-from-session-pageids/62988/9 "2022-08-16T06:33:41Z")

</div>

i’ve done this in javascript, let me go check to see if it works in perspective too.

---

<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 16, 2022, 6:45am UTC](https://forum.inductiveautomation.com/t/get-perspective-view-path-s-from-session-pageids/62988/10 "2022-08-16T06:45:15Z")

</div>

I (don’t think) I’ll be able to use javascript since I want to get this from all sessions running. I presume your script will run on a single client?

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [August 16, 2022, 7:31am UTC](https://forum.inductiveautomation.com/t/get-perspective-view-path-s-from-session-pageids/62988/11 "2022-08-16T07:31:03Z")

</div>

yeah its on the client, i dont immediately see a way to get it for all sessions

---

<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 16, 2022, 7:34am UTC](https://forum.inductiveautomation.com/t/get-perspective-view-path-s-from-session-pageids/62988/12 "2022-08-16T07:34:01Z")

</div>

I think it’s certainly possible from the API as it’s available in the gateway webpage; it’s just a matter of someone in the know sharing the secrets 😃 I ended up doing it manually for 28 connected clients, copying and pasting the stuff into Excel for each client. Very tedious, do not recommend!

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [August 16, 2022, 7:43am UTC](https://forum.inductiveautomation.com/t/get-perspective-view-path-s-from-session-pageids/62988/13 "2022-08-16T07:43:18Z")

</div>

yeah it should be accesible somewhere xd  
in js it was something like this: client.pages.views  
so if you can find the client through the session id…

?[PerspectiveSessionMonitor](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.15/com/inductiveautomation/perspective/gateway/session/PerspectiveSessionMonitor.html#getClientSessionsForProject(java.lang.String))

---

<div class="post-metadata">

**Author:** ![dustin.cooper](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dustin.cooper/32/29963_2.png) [@dustin.cooper](https://forum.inductiveautomation.com/u/dustin.cooper)\
**Post date:** [June 6, 2023, 10:04pm UTC](https://forum.inductiveautomation.com/t/get-perspective-view-path-s-from-session-pageids/62988/14 "2023-06-06T22:04:51Z")

</div>

If you're still looking for a solution on this, I ended up hacking together [something that might work](https://forum.inductiveautomation.com/t/get-perspective-session-page-info-from-pageids/74585/9?)
