Forcing Mobile and Tablet UI Experiences for iOS Devices - ben-vargas/servicenow-wiki GitHub Wiki
Quick Copy/Paste Path to Force Desktop Interface
/navpage.do?sysparm_device=doctype
This article describes how to force iOS (iPhone) and iPadOS (iPad) devices to use their respective mobile and tablet UI experiences within ServiceNow. This ensures a consistent and optimized user experience across these different device types. It also provides a method for returning to the standard desktop view if necessary (or forcing iPhone/iPad devices to desktop experience).
ServiceNow automatically tries to detect the device type being used when a user logs in and will direct the user to the correct interface. However, in some circumstances, the auto-detection might not work as expected, or you might need to force specific devices to a certain UI. For instance, you might want to ensure iPad users always see the tablet UI, and iPhone users always see the mobile UI. This article provides information on how to force the specific UI using url parameters.
ServiceNow offers specific URL parameters that can be used to force the UI experience, regardless of the device type. These parameters can be applied directly to the URL used to access ServiceNow.
URL Parameters for Device Type Selection:
Here are the URL parameters you can use to force a specific UI:
-
Mobile View:
-
URL:
https://<your-instance-name>.service-now.com/$m.do#
- Description: This URL parameter forces the user to access the ServiceNow instance using the mobile UI, optimized for smaller screen devices like iPhones.
-
URL:
-
Tablet View:
-
URL:
https://<your-instance-name>.service-now.com/$tablet.do#
- Description: This URL parameter forces the user to access the ServiceNow instance using the tablet UI, optimized for larger touch screen devices like iPads.
-
URL:
-
Return to Previous Desktop View (UI14):
-
URL:
https://<your-instance-name>.service-now.com/navpage.do?sysparm_device=browser
- Description: This URL parameter forces the user to return to the older UI14 desktop interface. (This UI is no longer supported and should not be used in most instances).
-
URL:
-
Return to Current Desktop View (UI15/UI16):
-
URL:
https://<your-instance-name>.service-now.com/navpage.do?sysparm_device=doctype
- Description: This URL parameter forces the user to return to the standard desktop interface, regardless of the device.
-
Note: Using
/navpage.do?sysparm_device=doctype
on an iPhone or iPad will force the desktop interface if desired.
-
URL:
Here are methods for implementing this solution:
-
Direct URL Access:
- Users can bookmark the appropriate URLs directly in their browsers.
- These URLs can be provided to users via documentation or communication channels.
-
Mobile Device Management (MDM):
- MDM solutions can be configured to enforce specific URLs for ServiceNow based on the device type.
- This can be done via device profiles to ensure all devices are accessing the system via the appropriate URL.
-
Conditional Redirects:
- Using a business rule or UI script, you can implement logic to redirect users to the appropriate UI based on the user agent string.
- This method gives granular control over the UI selection based on certain conditions.
-
Custom Links/Bookmarks:
- Create custom links within the ServiceNow platform that redirect users to the different interfaces.
- This can be done using UI Actions or by updating the system navigation.
You could use a UI Script to force a redirect based on the User Agent string of the device.
- Create a new UI Script with the following:
- Name:
Force Mobile/Tablet View
- Global:
true
- Script:
(function() { var userAgent = navigator.userAgent.toLowerCase(); var isIpad = userAgent.includes('ipad') || (userAgent.includes('macintosh') && navigator.maxTouchPoints > 1) var isIphone = userAgent.includes('iphone'); if (isIpad) { if(window.location.href.indexOf('$tablet.do') < 0){ window.location.href = window.location.origin + '/$tablet.do#'; } } else if(isIphone){ if(window.location.href.indexOf('$m.do') < 0) { window.location.href = window.location.origin + '/$m.do#'; } } })();
- This will redirect any users on iPads to the Tablet View, and iPhones to the Mobile View
- Name:
- Testing: Thoroughly test the URLs and redirect methods on different devices and browsers.
- User Experience: Make sure the experience is user-friendly and easy to use, ensuring the correct UI is loaded for their device.
- MDM Integration: Leverage MDM solutions to automate URL enforcement for managed devices.
- Fallback Options: Provide clear instructions for users who may need to switch to a different view manually or how to return to the standard desktop interface if needed.
- User Communication: Always notify users of these changes and how to access the correct interface for their devices.
- Performance: Be cautious of redirects and any negative performance implications.
- User Preferences: Consider adding a user preference or setting that allows users to override the forced UI, providing more flexibility.
- Device Detection: Instead of simply relying on the user agent strings, use more advanced methods to detect the specific device if needed.
- UI Customization: Use this solution in conjunction with other methods of customizing the UI experience such as themes and UI builder for more granular control.
- Consistent User Experience: Ensures that all users on iPads and iPhones see the intended UI.
- Support for Different User Groups: You can set up different links for different user groups based on their most commonly used devices.
- Testing and Debugging: Test and debug specific mobile and tablet interfaces more effectively.
- Training: Provide training on the use of the correct interface for various user groups.
Using these URL parameters, you can enforce the use of specific UI experiences based on the device type being used. Combining this with MDM or conditional redirects, you can ensure a consistent and optimized user experience across all of your iOS and iPadOS devices when accessing ServiceNow. Remember to test all changes thoroughly in a non-production instance before deploying to production.