how do I get the user's operative system name in a topic block
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2022 09:27 AM
As far as I understand the window object is not available in the virtual agent. Is there a way to get the user's operative system name? with the window object I would do something like this: window.navigator.appVersion. Is there an equivalent in servicenow?
Thanks in advance
- Labels:
-
Virtual Agent

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2022 10:38 AM
What do you mean by "operative system name"? The unique sys_id?
If so, they make it super easy by storing the user in a vaInput, so you can get the user's sys_id by code or configuration by selecting vaInputs.user.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2022 12:46 PM
I mean, is it possible to get the user's O.S name if it is not stored in any table? As in, is the user , using windows or linux?
The use case is the following, in a topic block, I am sending a request to an api and one of the required parameters is :platform. so, I would need to store the platform name in a variable to pass it to the api.
thanks in advance

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2022 02:50 PM
Ah, OS, "operating system", thanks for the clarification - completely tripped up by those couple different letters.
Do you guys use CMDB (and Discovery) in ServiceNow? That'd be your best bet to query the cmdb_ci_computer table and find the user's device(s).
If you don't use Discovery or have that information in your CMDB, then I'm going to say decently confidently you will not be able to get the user's OS programmatically from VA. VA runs server-side and I don't think there's any way you could get it to run client-side scripts which is what you'd need to do.
To be frank, you'd probably just be best off asking the user. I know good design wouldn't ask many technical questions if not needed, but if you have Linux users, I gotta imagine they know who they are. And Mac users know if there's an apple logo on their computer at the least. You could always give context clues in your wording to be safe, i.e. "What device are you using: Windows (default), Linux (power user), OS X (Apple/Mac)".

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2022 07:27 AM
If you would like to know about virtual agent scripting, these are two best resources you can find.
https://community.servicenow.com/community?id=community_article&sys_id=a70b286cdb90e410f21f5583ca961967
https://docs.servicenow.com/bundle/rome-now-intelligence/page/administer/virtual-agent/concept/virtual-agent-scripts.html