For the managed package runtime, several variables are available across the framework to provide contexts to cards, data sources, flyouts, templates, and other components.
This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see Omnistudio Help.
All variables are case sensitive.
|
Name |
Variable |
Access |
Example |
|---|---|---|---|
|
Page Parameters Represents the page parameters passed to the URL. |
|
Global |
/apex/consolecards?id=123 represents {{params.Id}} ,equaling 123. |
|
Object The object represented in the card, which holds all the fields and information for the record. |
|
Card |
If the object for the card has an Account such that Name = 'Test', obj.Name = 'Test'. |
|
Parent (for flyouts only) The parent object of the flyout. |
|
Global (Flyout) |
SELECT Id, Name FROM Contact WHERE AccountId = {parent.obj.Id} where {parent.obj.Id} equals the ID of the object in the card that contains the flyout. |
|
Parent Layout Gives access to the parent layout scope. |
|
Card |
|
|
Attributes Allows access to the attributes passed to the vloc-card, vloc-layout, and vloc-cmp directives |
|
Global |
<vloc-card name="community-account" customtemplate="community-sidebar-ads"> </vloc-card> Access the name and custom template by calling {{attrs.name}} and {{attrs.customtemplate}}. |
|
Session Variables Variables that are set in the designer for runtime use, they can access any property in the scope plus the {{payload}} variable. |
|
Layout or Card |
You can set a session variable to be named: Title and set it to obj.Name in the designer. |
|
Payload A temporary variable used by the session variables to access the entire result of a data source. |
|
Layout or Card |
The variable holds the entire result of the data source so you can access other properties like payload.totalSize while using a result variable of result.records in the Datasource. |
|
Imported Scope The framework allows for external modules and controllers to be imported into the cards, layouts, and components. Importing the scope can then extend the functionality of the framework, for example, the |
|
Global to the inserted component. If imported into a layout, the cards also have access. |
Excerpt from the community templates: Component with imported
Template using imported logic:
Controller imported:
|
|
User Information Variable Information about the user is fetched on the start of the framework. The information is stored under the $rootScope.vlocity variable and is available inside templates in $root.vlocity. |
{{$root.vlocity}} |
Layout or Card |
Example of a query on a card data source using a contextId: Select AccountId, Account.Name, Name, Birthdate,Phone FROM Contact where AccountId = '{{$root.vlocity.userAccountId}}' User information available:
|