Mobile deep link structure
Summarize
Summary of Mobile deep link structure
This guide explains how to construct and use mobile deep links within ServiceNow mobile apps, specifically for the Now Mobile and Mobile Agent apps. Mobile deep links enable users to directly open specific screens or forms in the mobile apps, enhancing navigation efficiency and user experience.
Show less
Key Components of Mobile Deep Links
- Variable Name: Any identifiable variable name can be assigned to the deep link for easy reference in code.
- Mobile App Call: Specify the target mobile app, either Request for the Now Mobile app or Agent for the Mobile Agent app, to direct the deep link accordingly.
- Public Method: Use one of several public methods to generate links to various screen types or authentication experiences within the mobile apps.
Public Methods and Their Use Cases
- getButtonLink(buttonId, tableName, recordSysId): Opens an input form screen via a button. Requires the button’s sysid; table name and record sysid are optional.
- getFormScreenLink(formScreenId, tableName, recordSysId): Opens a non-parameterized form screen. All parameters are required.
- getLauncherScreenLink(launcherScreenId): Opens a launcher screen specified by its sysid.
- getPrefillLink(forceLocalLogin): Useful for new mobile users to pre-fill instance login details. Set true to auto-fill or false for manual entry. Does not link to a specific screen.
- getScreenLink(documentId, uiParams): Links to list or non-parameterized screens. Requires the screen’s sysid; uiParams is optional for additional UI data.
- getSSOPrefillLink(sysid): Generates a link for Single Sign-On (SSO) authentication using a specified Identity Provider (IdP). Requires the Multi-Provider SSO plugin and active IdP sysid from the Identity Providers table.
- getUniversalLink(url): Creates a link to a list, form, or browser screen based on the provided URL.
Practical Benefits for ServiceNow Customers
- Enables precise navigation within mobile apps, improving user efficiency.
- Supports different authentication scenarios, including SSO for diverse user groups.
- Facilitates onboarding of first-time mobile users through pre-filled login links.
- Allows embedding of secure, deep-linked URLs in communications like emails to streamline access.
Implementation Notes
- Always assign clear variable names to deep links for maintainability.
- Choose the mobile app context carefully depending on target user roles and app functionality.
- Ensure the Multi-Provider SSO plugin is activated and configured to use SSO-based deep links.
- Use sysid values from relevant tables (buttons, forms, screens, IdPs) to generate accurate deep links.
Familiarize yourself with how to construct and use mobile deep links in any screen type within a mobile app.
Mobile deep links essentially consist of three components. The name of the variable, a
reference to a mobile app, and the public method used to pull the mobile deep link. The
following mobile deep link has a variable with the name deepLinkGen, where
a specified screen opens in the Mobile Agent.
var deepLinkGen= new global.MobileDeepLinkGenerator('Agent');
return deepLinkGen.getScreenLink('73f3d135532033002d96ddeeff7b1212');- Variable name
- You can give any variable name for the mobile deep link, although it should be identifiable for future reference.
- Mobile app call
- Enter one of the mobile apps that the mobile deep link points to. You can enter either
Requestfor the Now Mobile app orAgentfor the Mobile Agent app. For example, to generate a link using the mobile deep link generator that points to the Now Mobile app, use the following code:new global.MobileDeepLinkGenerator('Request'); - Public method
- Use one of the public methods that can be used to create a mobile deep link. Reference
the table for an explanation of each method, and the reason for its use.
Method Reason for use Method parameters getButtonLink(buttonId, tableName, recordSysId)getButtonLink is used to link into any input form screen. buttonId (required): sys_id of the button you want to launch the input form screen tableName (optional): name of the table for the current context
recordSysId (optional): sys_id of the current context record
getFormScreenLink(formScreenId, tableName, recordSysId)getFormScreenLink is used to link into any non-parameterized form screen. formScreenId (required): sys_id of required form screen tableName (required): table name of required form screen
recordSysId (required): sys_id of record from tableName
getLauncherScreenLink(launcherScreenId)getLauncherScreenLink is used to link into any launcher screen. launcherScreenId (required): sys_id of the required launcher screen. getPrefillLink(forceLocalLogin)getPrefillLink is useful for first-time ServiceNow mobile users. This link format pre-fills the instance link for users who have not yet added an instance to their mobile app. This method is the default authentication experience. This method does not generate a link to a specific screen.
forceLocalLogin (required): Enter true for the system to pre-fill the instance login details of the user.
Enter false, for the user to manually enter login details.
getScreenLink(documentId, uiParams)getScreenLink is used to link into any list screens, including both parameterized and non-parameterized types. Can also be used for any non-parameterized screen type. An optional UI parameter can be passed into this method. documentId (required): sys_id of desired screen uiParams (optional): Parameter of a data item
getSSOPrefillLink(sys_id)getSSOPrefillLink generates a link that uses the identity provider (IdP) that is identified by the sys_idparameter. This link can be used to authenticate end users that use different IdPs. For example, pre-hires might use Microsoft Azure as their IdP, and on-boarded employees might use Okta as their IdP. A common use of these SSO (single sign-on) pre-filled links is to embed them in emails sent to employees. These emails contain a link that can be used to log in securely to a ServiceNow instance using their mobile apps.Important:You must activate the Multi-Provider SSO plugin and have an active IdP to use this method. For more information, see Activate Multi-Provider SSO pluginsys_id (required): Enter the sys_id of the IdP you want to use from the Identity Providers [sso_properties] table. To get the sys_id of the IdP:- Navigate to .
- Right-click an identity provider record and select Copy sys_id.
getUniversalLink(url)getUniversalLink generates a link into either a list, form, or browser. A screen is generated based on the content of this URL. See Universal linking for mobile. url (required): a link to a resource on an instance