You are here:
Target URL and URL Parameters (Managed Package)
For the managed package runtime, to launch Vlocity Omniscripts, Vlocity Cards components, web pages, or external applications from a Vlocity Action, enter an Apex page, or a URL with parameters as the Target URL. LWC components, such as LWC Omniscripts, LWC Cards, and Flexcards, are not URL addressable and so can't be accessed directly from a URL and must embedded on a page.
This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see Omnistudio Help.
For out-of-the-box Vlocity Actions, such as View Record, the Target URL/{0} does not work outside of Salesforce Classic. To navigate to a page in Salesforce Lightning Experience, update the URL to /lightning/r/[ObjectName]/{0}/view, where ObjectName is the API name of the sObject such as Account.
Available Visualforce Pages to Launch Omniscripts
Vlocity provides these Visualforce pages to launch Omniscripts:
-
OmniScriptUniversalPage
-
OmniScriptUniversalPageWHeader
-
OmniScriptUniversalPageWHeaderSidebar.
-
OmniScriptUniversalMobilePage (for use with Mobile only)
-
OmniScriptUniveralPageConsole (for use in the Industry Console)
-
OmniScriptUniversalCommunitiesPage (for use in Communities)
Formatting the Target URL
For a Target URL that launches a Vlocity Card component or a Vlocity Omniscript, the first part of the URL is the apex page, followed by the PageName, such as /apex/<PageName>. The second part of the Target URL is a list of parameters defined in the URL Parameters field and is available to any URL types Vlocity Actions support, including web pages and external applications.
The following example shows how to format the URL:
//Example Target URL for launching an OmniScript
/apexNS__[PageName]?id={0}#/OmniScriptType/AAA1/OmniScriptSubType/AAA2/OmniScriptLang/AAA3/layout/[LayoutName]/ContextId/{0}/PrefillDataRaptorBundle/[BundleName]/[verticalMode]
//Example Target URL for launching a Card component
/apex/NS__[PageName]?id={0}#/layout=[LayoutName]
//Example External URL
https://www.domainName.com/?id={0}/
Beginning with Vlocity Version 12, an alternative URL pattern is available:
//Example Target URL for launching an OmniScript
/apexNS__[PageName]?id={0}&OmniScriptType=AAA1&OmniScriptSubType=AAA2&OmniScriptLang=AAA3&layout=[LayoutName]]&PrefillDataRaptorBundle=[BundleName]&scriptMode=[verticalMode]
//Example Target URL for launching a Card component
/apex/NS__[PageName]?id={0}&layout=[LayoutName]
//Example External URL
https://www.domainName.com/?id={0}/
While both URL patterns are valid, the advantage of the alternative pattern is that it is mobile-friendly and enables adding additional URL parameters directly into the Omniscript Data JSON. For example, appending &customerSLALevel=gold to the URL would add a node to the root of the Omniscript Data JSON, such as "customerSLALevel":"gold".
Target URL Variable Descriptions
This table lists descriptions for the variables from the Target URL examples on this page:
Variable |
Description |
Available For |
|---|---|---|
NS__ |
Namespace of the installed package. Use when referencing a Universal Visualforce page. |
Omniscript, Card |
[PageName] |
Universal Visualforce page, OmniScriptUniversalPage, OmniScriptUniversalPageWHeader, OmniScriptUniversalPageWHeaderSidebar, or OmniScriptUniversalMobilePage) or another Visualforce page containing the Omniscript. |
Omniscript, Card |
{0} |
The first parameter listed in the URL Parameters field and is often the Context Id of an sObject. See URL Parameters on this page. |
Omniscript, Card |
AAA1 |
Omniscript Type |
Omniscript |
AAA2 |
Omniscript Sub Type |
Omniscript |
AAA3 |
Omniscript Language |
Omniscript |
[LayoutName] |
|
Omniscript, Card |
[BundleName] |
(Optional) Omnistudio Data Mapper Bundle name used for prefilling fields in the script. |
Omniscript |
[verticalMode] |
(Optional) true or false. If true, all the steps in an Omniscript are vertically stacked. If false, all the steps in an Omniscript are horizontally navigated. Default is true. |
Omniscript |
URL Parameters
In a Target URL, the {0} represents the indexed position of a parameter in the list of parameters in the URL Parameter field. The parameter is the field API name in the applicable object, such as AccountId, or ID in Contact.
Specify the parameters as a comma-delimited string, in the sequence in which you want to replace the parameters in the Target URL. For example, AccountId,vlocity_ins__PrimaryContactId__c, replaces {0} in the Target URL with the AccountId, and replaces {1} in the Target URL with the vlocity_ins__PrimaryContactId__c.
You can also use attributes from the User object, such as User.ContactId to get the Id of the current user.
Beginning with CME Fall '18, Vlocity supports the Salesforce object edit URL format of /{3 character sobject prefix}/e'.
URL Parameter Example
//Example Target URL for launching a Card component
/apex/vlocity_ins__OmniScriptUniversalPage?id={0}&OmniScriptType=AppointmentApplication&OmniScriptSubType=IndependentAgentAppointmentApplication&OmniScriptLang=English&layout=lightning
//Example Target URL for launching a Card component
/apex/NameSpace__ConsoleCards?id={0}&layout=lex-layout

