
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2022 10:44 AM
We use email notifications regularly to deliver information to customers and fulfillers alike.
These notifications almost invariably have a link to the contextual record in ServiceNow.
For example, "New comment or work note added to INCxxxxxxx - Blah blah blah" would go to the Assigment group members (if there is no assignee) or the Assigned to person (if there is one).
That email contains a link to open the Incident.
If I am on a mobile device reading that email in my mobile email app (Outlook, typically, at my company), and I tap that hyperlink to open the record in question, I need that target record to automatically open in the Agent app, not in the default browser on my mobile device.
With the Classic app, we didn't need to do anything special (iirc) w/ the URLs to make them open in the app vs. the browser. They would just behave properly on their own. (At worst I think they'd load in a browser but it would be formatted w/ the "$m.do" URL so would force the app UI within the browser.)
I cannot seem to find any simple explanation of how to do this and I don't understand why. It seems like such an obvious thing and I feel like I'm too old and/or stupid to find where the answer lies.
Any help would be greatly appreciated.
Solved! Go to Solution.
- Labels:
-
Agent Mobile App
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2022 10:56 AM
Hi Aaron,
You can do this by using the mobileDeepLinkGenerator. So when you look at an incident record in the Agent app, then that screen should take a sys_id as a parameter.
It's been fairly long since I configured this, but I just found an article that does this step by step: https://community.servicenow.com/community?id=community_article&sys_id=5a7c69221bf03010aefc11751a4bc...
I used to do it by doing it something like this:
var id = current.getUniqueValue() + '';
var deepLinkGenerator = new global.MobileDeepLinkGenerator("agent");
var link = deepLinkGenerator.getFormScreenLink("c955de07dbf7641019c83307f4961975", 'incident', id); //sys_id is the id of the applet displaying your record
But I like the article, since it gives you the dynamic link - so either it goes to the portal or it goes to the mobile app! 🙂
Best regards,
Sebastian Laursen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2022 10:56 AM
Hi Aaron,
You can do this by using the mobileDeepLinkGenerator. So when you look at an incident record in the Agent app, then that screen should take a sys_id as a parameter.
It's been fairly long since I configured this, but I just found an article that does this step by step: https://community.servicenow.com/community?id=community_article&sys_id=5a7c69221bf03010aefc11751a4bc...
I used to do it by doing it something like this:
var id = current.getUniqueValue() + '';
var deepLinkGenerator = new global.MobileDeepLinkGenerator("agent");
var link = deepLinkGenerator.getFormScreenLink("c955de07dbf7641019c83307f4961975", 'incident', id); //sys_id is the id of the applet displaying your record
But I like the article, since it gives you the dynamic link - so either it goes to the portal or it goes to the mobile app! 🙂
Best regards,
Sebastian Laursen

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2022 12:42 PM
Thank you Sebastian.
So one of the problems I am having is I cannot figure out how to find the right sys_id for the getFormScreenLink function. I know by looking at the product documentation (here) that this is a reference to the sys_sg_screen table, but...
- How do I figure out which of the 255 records listed here is the right one to open, say, an Incident form?
- I don't understand why I can't find the sys_id values given either in your example here, or in the article you linked to (in the "Create a Script Include..." section).
Thank you again!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2022 01:56 PM
Ah yes, that is also a tricky one. Again, it's been a while, but I usually do it step by step from the backend, so I can trace the screen I want.
1) System Mobile -> Navigation Bars -> Mobile Agent
2) Find a tab that contains your desired screen (so out of the box it could be "My work". Click on it.
3) Navigate to the Launcher Screen.
4) In the "Body" tab, click on "My incidents" and open it. There should be a "Destination Screen" reference - click on it.
5) Click on the "Open" Screen Segments.
6) In the Stream M2M Segments, Click on "My Incidents Item Stream".
7) In the Stream M2M Item configs - Click on "My Incidents Main Item".
😎 Finally, in here you can get the sys_id from the "Embedded Screen" reference.
Now, depending on your configurations etc. it might look different for you, but if you go by the starting point of the Navigation Bars, then you should, at some point, be able to locate the right screen (hopefully) hehe!
Best regards,
Sebastian Laursen

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2022 07:07 AM
Thank you Sebastian. Not to detract from your helpful advice--if nothing else perhaps this is confirmation of its effectiveness--but I managed to find that same "My incident" record yesterday on my own.
Today, with your confirmation, and having abandoned the article you linked me to, which I was not able to get working, I tried again building the link directly in an email script, as in your personal example, and it worked! The add'l link in the email opened the record in the Agent app!
Now if I can wrap my head around a more dynamic way of doing this I'll be in business. I'm less concerned about having an add'l "Open this record in the Agent app" link in emails than I am about having the links--whatever they are--function properly when tapped.
In case anyone wants to use the working example I have for their own needs, here's a screenshot of that email script (the highlighted bits are the lines you gave, but with the sys_id of our 'My incident' record):
Thank you again for all your help!!