---
schema_version: "1"
id: 35dade764ac002e9470c4faf89e16d34d1cb4867852b23bf8606779e64b9a4d4
title: Cards Context Variables (Managed Package)
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_cards_context_variables.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_cards_context_variables.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 7faaf86565488dde407726a4ca7af113948ac10f94dee7f182020ed1dc17118b
description: For the managed package runtime, several variables are available across the framework to provide contexts to cards, data sources, flyouts, templates, and other components.
products:
  - Omnistudio
release: "264"
---
# Cards Context Variables (Managed Package)

For the managed package runtime, several variables are available across the framework to provide contexts to cards, data sources, flyouts, templates, and other components.

![Managed Package app icon](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/resources-global/_corporate/images/managedpackageicon.png) This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see [Omnistudio Help](https://help.salesforce.com/s/articleView?id=xcloud.os_omnistudio_standard.htm&language=en_US).

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/images/icon_note.png)

Note

All variables are case sensitive.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
      <colgroup>
        <col>
        <col>
        <col>
        <col>
      </colgroup>
      <thead class="slds-text-title_caps ">
        <tr class="">
          <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d266985e53">
            <p style="margin-bottom:0;">Name</p>
          </th>
          <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d266985e59">
            <p style="margin-bottom:0;">Variable</p>
          </th>
          <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d266985e65">
            <p style="margin-bottom:0;">Access</p>
          </th>
          <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d266985e71">
            <p style="margin-bottom:0;">Example</p>
          </th>
        </tr>
      </thead>
      <tbody>
        <tr class="">
          <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d266985e53 ">
            <p>Page Parameters</p>
            <p style="margin-bottom:0;">Represents the page parameters passed to the URL.</p>
          </td>

          <td data-label="Variable" class="slds-cell-wrap" style="vertical-align:top;" headers="d266985e59 ">
            <p style="margin-bottom:0;">
              <code>{{params}}</code>
            </p>
          </td>

          <td data-label="Access" class="slds-cell-wrap" style="vertical-align:top;" headers="d266985e65 ">
            <p style="margin-bottom:0;">Global</p>
          </td>

          <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d266985e71 ">
            <p>/apex/consolecards?id=123</p>
            <p style="margin-bottom:0;">represents <kbd>{{params.Id}}</kbd> ,equaling 123.</p>
          </td>

        </tr>
        <tr class="">
          <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d266985e53 ">
            <p>Object</p>
            <p style="margin-bottom:0;">The object represented in the card, which holds all the fields and information for the record.</p>
          </td>

          <td data-label="Variable" class="slds-cell-wrap" style="vertical-align:top;" headers="d266985e59 ">
            <p style="margin-bottom:0;">
              <code>{{obj}}</code>
            </p>
          </td>

          <td data-label="Access" class="slds-cell-wrap" style="vertical-align:top;" headers="d266985e65 ">
            <p style="margin-bottom:0;">Card</p>
          </td>

          <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d266985e71 ">
            <p style="margin-bottom:0;">If the object for the card has an Account such that <kbd>Name = 'Test'</kbd>, <kbd>obj.Name = 'Test'</kbd>.</p>
          </td>

        </tr>
        <tr class="">
          <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d266985e53 ">
            <p>Parent (for flyouts only)</p>
            <p style="margin-bottom:0;">The parent object of the flyout.</p>
          </td>

          <td data-label="Variable" class="slds-cell-wrap" style="vertical-align:top;" headers="d266985e59 ">
            <p style="margin-bottom:0;">
              <code>{{parent}}</code>
            </p>
          </td>

          <td data-label="Access" class="slds-cell-wrap" style="vertical-align:top;" headers="d266985e65 ">
            <p style="margin-bottom:0;">Global (Flyout)</p>
          </td>

          <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d266985e71 ">
            <p>
              <kbd>SELECT Id, Name FROM Contact WHERE AccountId = {parent.obj.Id}</kbd>
            </p>
            <p style="margin-bottom:0;">where <kbd>{parent.obj.Id}</kbd> equals the ID of the object in the card that contains the flyout.</p>
          </td>

        </tr>
        <tr class="">
          <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d266985e53 ">
            <p>Parent Layout</p>
            <p style="margin-bottom:0;">Gives access to the parent layout scope.</p>
          </td>

          <td data-label="Variable" class="slds-cell-wrap" style="vertical-align:top;" headers="d266985e59 ">
            <p style="margin-bottom:0;">
              <code>{{parentLayout}}</code>
            </p>
          </td>

          <td data-label="Access" class="slds-cell-wrap" style="vertical-align:top;" headers="d266985e65 ">
            <p style="margin-bottom:0;">Card</p>
          </td>

          <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d266985e71 ">&nbsp;</td>

        </tr>
        <tr class="">
          <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d266985e53 ">
            <p>Attributes</p>
            <p style="margin-bottom:0;">Allows access to the attributes passed to the vloc-card, vloc-layout, and vloc-cmp directives</p>
          </td>

          <td data-label="Variable" class="slds-cell-wrap" style="vertical-align:top;" headers="d266985e59 ">
            <p style="margin-bottom:0;">
              <code>{{attrs}}</code>
            </p>
          </td>

          <td data-label="Access" class="slds-cell-wrap" style="vertical-align:top;" headers="d266985e65 ">
            <p style="margin-bottom:0;">Global</p>
          </td>

          <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d266985e71 ">
            <p>
              <kbd>&lt;vloc-card name="community-account" customtemplate="community-sidebar-ads"&gt; &lt;/vloc-card&gt;</kbd>
            </p>
            <p style="margin-bottom:0;">Access the name and custom template by calling <kbd>{{attrs.name}}</kbd> and <kbd>{{attrs.customtemplate}}</kbd>.</p>
          </td>

        </tr>
        <tr class="">
          <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d266985e53 ">
            <p>Session Variables</p>
            <p style="margin-bottom:0;">Variables that are set in the designer for runtime use, they can access any property in the scope plus the <kbd>{{payload}}</kbd> variable.</p>
          </td>

          <td data-label="Variable" class="slds-cell-wrap" style="vertical-align:top;" headers="d266985e59 ">
            <p style="margin-bottom:0;">
              <code>{{session}}</code>
            </p>
          </td>

          <td data-label="Access" class="slds-cell-wrap" style="vertical-align:top;" headers="d266985e65 ">
            <p style="margin-bottom:0;">Layout or Card</p>
          </td>

          <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d266985e71 ">
            <p style="margin-bottom:0;">You can set a session variable to be named: Title and set it to obj.Name in the designer.</p>
          </td>

        </tr>
        <tr class="">
          <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d266985e53 ">
            <p>Payload</p>
            <p style="margin-bottom:0;">A temporary variable used by the session variables to access the entire result of a data source.</p>
          </td>

          <td data-label="Variable" class="slds-cell-wrap" style="vertical-align:top;" headers="d266985e59 ">
            <p style="margin-bottom:0;">
              <code>{{payload}}</code>
            </p>
          </td>

          <td data-label="Access" class="slds-cell-wrap" style="vertical-align:top;" headers="d266985e65 ">
            <p style="margin-bottom:0;">Layout or Card</p>
          </td>

          <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d266985e71 ">
            <p style="margin-bottom:0;">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.</p>
          </td>

        </tr>
        <tr class="">
          <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d266985e53 ">
            <p>Imported Scope</p>
            <p style="margin-bottom:0;">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 <code>{ctrl}</code> attribute.</p>
          </td>

          <td data-label="Variable" class="slds-cell-wrap" style="vertical-align:top;" headers="d266985e59 ">
            <p style="margin-bottom:0;">
              <code>{{importedScope}}</code>
            </p>
          </td>

          <td data-label="Access" class="slds-cell-wrap" style="vertical-align:top;" headers="d266985e65 ">
            <p>Global to the inserted component.</p>
            <p style="margin-bottom:0;">If imported into a layout, the cards also have access.</p>
          </td>

          <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d266985e71 ">
            <p>Excerpt from the community templates:</p>
            <p>Component with imported <code>ctrl</code>; see <code>ctrl</code> attribute inserted the <code>infoCtrl</code>:</p>
            <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>
                <kbd>&lt;vloc-cmp name="frame" customtemplate="community-content-frame" loaded="true"&nbsp;
ctrl="infoCtrl" ng-show="!$root.showContent"&gt;&nbsp;
&lt;/vloc-cmp&gt;</kbd>
              </code></pre>
            <p>Template using imported logic:</p>
            <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>&lt;div class="info"&gt;
&lt;h2 ng-click="$root.showContent = !$root.showContent; importedScope.url = '';"&gt;
&lt;span class="icon icon-v-left-caret"&gt;
&lt;/span&gt;Back
&lt;/h2&gt;
&lt;iframe ng-src="https://help.salesforce.com/s/%7B%7BimportedScope.url%7D%7D" onload="iframeLoaded()"ng-show="importedScope.loaded"&gt;
&lt;/iframe&gt;
&lt;/div&gt;</code></pre>
            <p>Controller imported:</p>
            <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>.controller('infoCtrl', 
function($scope, $rootScope, remoteActions, force, $sce)
{ $scope.loaded = false;
$rootScope.$on('actionSelected',function(event, action) {
console.log(action.url);
$scope.loaded = false;
$rootScope.showContent = false;
$scope.url = $sce.trustAsResourceUrl(action.url);
});
window.iframeLoaded = function() {
if ($scope.url) {
console.log('Community frame loaded');
$scope.loaded = true;
$scope.$apply();
}
};
});</code></pre>
          </td>

        </tr>
        <tr class="">
          <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d266985e53 ">
            <p>User Information Variable</p>
            <p style="margin-bottom:0;">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.</p>
          </td>

          <td data-label="Variable" class="slds-cell-wrap" style="vertical-align:top;" headers="d266985e59 ">
            <p style="margin-bottom:0;">{{$root.vlocity}}</p>
          </td>

          <td data-label="Access" class="slds-cell-wrap" style="vertical-align:top;" headers="d266985e65 ">
            <p style="margin-bottom:0;">Layout or Card</p>
          </td>

          <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d266985e71 ">
            <p>Example of a query on a card data source using a contextId:&nbsp;<kbd>Select AccountId, Account.Name, Name, Birthdate,Phone FROM Contact where AccountId&nbsp; = '{{$root.vlocity.userAccountId}}'</kbd>
            </p>
            <p>User information available:</p>
            <ul>
              <li>
                <p>User Id: <code>$root.vlocity.userId</code>
                </p>
              </li>

              <li>
                <p>User Name : <code>$root.vlocity.userName</code>
                </p>
              </li>

              <li>
                <p>User Type: <code>$root.vlocity.userType</code>
                </p>
              </li>

              <li>
                <p>User Role: <code>$root.vlocity.user</code>
                </p>
              </li>

              <li>
                <p>User Profile Id : <code>$root.vlocity.userProfileId</code>
                </p>
              </li>

              <li>
                <p>User Profile Name : <code>$root.vlocity.userProfileName</code>
                </p>
              </li>

              <li>
                <p>User Account Id : <code>$root.vlocity.userAccountId</code>
                </p>
              </li>

              <li>
                <p>User Contact Id : <code>$root.vlocity.userContactId</code>
                </p>
              </li>

              <li>
                <p>Locale&nbsp;in browser lowercase format : <code>$root.vlocity.userAnLocale</code>&nbsp;</p>
              </li>

              <li>
                <p>Locale in Salesforce format: <code>$root.vlocity.userSfLocale</code>
                </p>
              </li>

              <li>
                <p>Currency code: <code>$root.vlocity.userCurrency</code>
                </p>
              </li>

              <li>
                <p>Language: <code>$root.vlocity.userLanguage</code>
                </p>
              </li>

              <li>
                <p>Time Zone: <code>$root.vlocity.userTimeZone</code>
                </p>
              </li>

            </ul>
          </td>

        </tr>
      </tbody>
    </table>