Dynamic Mobile vs Portal Redirection from Email Notification
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Hi,
I am currently working on a requirement where users need to be redirected based on the device they are using. We have email notifications that contain a "View My Task" button, which currently redirects users to the Service Portal using the URL below:
https://<instance-name>.service-now.com/sp?id=ticket&table=sc_req_item&sys_id=<ritm-sysID>
The requirement is that when a user opens the email notification from Outlook on a mobile device, the link should redirect them to the mobile experience/mobile portal instead of the standard portal.
While testing, I noticed that the URL used when accessing the portal from a mobile device is different from the standard instance URL. For example, the mobile URL appears in the following format:
https://<instance-name>.service-now.com.mcas.ms/sp
Since the instance name can vary across environments, I would like to make this URL dynamic. For the standard instance URL, we typically use gs.getProperty('glide.servlet.uri');
I would like to know whether there is a similar property available that returns the mobile-specific URL. If no such property exists, what would be the recommended approach to dynamically construct the mobile URL based on the current instance?
Additionally, is there any supported way to detect whether the user is opening the link from a mobile device and redirect them accordingly from within an email notification link?
Thanks in advance.
