- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2018 10:12 AM
I am currently working on allowing our users to access SN on mobile devices. When a user is accessing our SN instances from a mobile browser, we only want them to see the Service Portal. There are 2 ways that I'm thinking of doing this:
1. Create a script include that returns true if the user is on a mobile browser.
2. Check the transaction log table for the useragent
The problem with 1 is that I havent found any method that allows me to get the browser data correctly.
The problem with 2 is that the transaction log table isnt updated when the user is on the Service Portal.
I wanted to know if there was any way in a script include to determine what browser is currently in use?
Or
Is possible to get the transaction log table to log browser information when a user is on the Service Portal?
Or
Is there some other way of doing this that I havent found yet?
If its not possible, i
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-25-2018 08:40 AM
I have found out from ServiceNow that gs.IsMobile does not run on Menu Item in Service Portal. I will have to use CSS to hide a link on my navigation menu. Thank you for everyones help.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2018 10:24 AM
I don't know if you can use a script include to check the browser since it is a Service Side and not client side. As for logging when users are on the service portal take a look at sp_log table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2018 10:30 AM
That table doesnt log the UserAgent information so it wont work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2018 10:35 AM
You can test, the "Testing for mobile devices in scripts" Doc article explains:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2018 10:42 AM
This only works if youre using the Mobile UI or the mobile app. I need to do this check on the Service Portal