# Get Client Activity Level

**URL:** <https://forum.inductiveautomation.com/t/get-client-activity-level/40536>\
**Category:** Ignition\
**Created:** [November 11, 2020, 3:52pm UTC](https://forum.inductiveautomation.com/t/get-client-activity-level/40536 "2020-11-11T15:52:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jramirez3](https://avatars.discourse-cdn.com/v4/letter/j/a183cd/32.png) [@jramirez3](https://forum.inductiveautomation.com/u/jramirez3)\
**Post date:** [November 11, 2020, 3:52pm UTC](https://forum.inductiveautomation.com/t/get-client-activity-level/40536/1 "2020-11-11T15:52:15Z")

</div>

Using the function system.util.getSessionInfo() gives me info about currently logged in clients. This is great but i want to see the activity value from an HMI like it shows in the gateway (Active or Dormant).

How can i get that value? I can’t find a function in the docs or the API at the moment.  
Anyone know where i can find a function to return the activity level?

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [November 11, 2020, 6:28pm UTC](https://forum.inductiveautomation.com/t/get-client-activity-level/40536/2 "2020-11-11T18:28:22Z")

</div>

Closest thing I see is [https://docs.inductiveautomation.com/display/DOC80/system.util.getInactivitySeconds](https://docs.inductiveautomation.com/display/DOC80/system.util.getInactivitySeconds)

If you know how many seconds before something becomes dormant you could use that value, but I don’t know what value Ignition uses to say that a client is ‘dormant’.

---

<div class="post-metadata">

**Author:** ![jramirez3](https://avatars.discourse-cdn.com/v4/letter/j/a183cd/32.png) [@jramirez3](https://forum.inductiveautomation.com/u/jramirez3)\
**Post date:** [November 11, 2020, 6:48pm UTC](https://forum.inductiveautomation.com/t/get-client-activity-level/40536/3 "2020-11-11T18:48:37Z")

</div>

This is a client scope script. I need someone to view this from a client about all clients.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [November 11, 2020, 6:55pm UTC](https://forum.inductiveautomation.com/t/get-client-activity-level/40536/4 "2020-11-11T18:55:01Z")

</div>

Create a database table or dataset tag called something like “userInactivity”.

Create a gateway timer script that first clears the `userInactivity` database table or resets it to your liking, and then does a [https://docs.inductiveautomation.com/display/DOC80/system.util.sendMessage](https://docs.inductiveautomation.com/display/DOC80/system.util.sendMessage) to all clients using `scope='C'`.

Create a client message handler to handle that incoming sendMessage from the gateway, where you run `system.util.getInactivitySeconds` and write that value and the current user to the database.
