---
schema_version: "1"
id: 10df59b801fa93f9c3ee570266e818e7237936cf870e1b2fa24af6f67ec37c86
title: Flexcards 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_flexcards_context_variables.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_flexcards_context_variables.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 276a7a2895cae1af2bab72b7e32ebb57963b30f9f71c287274164996395d7307
description: For the managed package runtime, global and local context variables are available to a Flexcard to provide context to data sources, actions, and other components. All variables are case sensitive.
products:
  - Omnistudio
release: "264"
---
# Flexcards Context Variables (Managed Package)

For the managed package runtime, global and local context variables are available to a Flexcard to provide context to data sources, actions, and other components. All variables are case sensitive.

![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).

## Global Variables

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col>
          <col>
          <col>
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d112455e51">
              <p style="margin-bottom:0;">Name</p>
            </th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d112455e57">
              <p style="margin-bottom:0;">Description</p>
            </th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d112455e63">
              <p style="margin-bottom:0;">Merge Field</p>
            </th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d112455e51 ">
              <p style="margin-bottom:0;">Label</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d112455e57 ">
              <p style="margin-bottom:0;">Salesforce Custom Labels. See <a href="https://help.salesforce.com/s/articleView?id=xcloud.os_add_custom_labels_to_supported_fields_on_a_flexcard.htm&amp;release=264.0.0&amp;type=5" title="For the managed package runtime, add custom labels to supported Flexcard element fields with the {Label} merge field. Custom labels are custom text values that can be accessed from Apex classes, Visualforce pages, or Lightning components. Add custom labels if your Flexcard supports multiple languages. The values can be translated into any language Salesforce supports.">Add Custom Labels to Supported Fields on a Flexcard (Managed Package)</a>.</p>
            </td>

            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d112455e63 ">
              <p>
                <kbd>{Label.mylabel}</kbd>
              </p>
              <p style="margin-bottom:0;">For example, <kbd>{Label.AccountName}</kbd> gets a custom label named <kbd>AccountName</kbd>.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d112455e51 ">
              <p style="margin-bottom:0;">objectApiName</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d112455e57 ">
              <p>Beginning Winter '22, pass the object API Name to a component as an attribute, such as a Custom LWC, when a Flexcard is on a record page. Similar to <kbd>{recordId}</kbd>, use <strong class="uicontrol">Test Parameters</strong> to verify in Preview. See <a href="https://help.salesforce.com/s/articleView?id=xcloud.os_test_data_source_settings_on_a_flexcard.htm&amp;release=264.0.0&amp;type=5" title="For the managed package runtime, preview a Flexcard with real data by adding test values to runtime variables. The variables populate the dynamic fields in a data source, such as a contextId from an Omnistudio Data Mapper that gets data from an Account.">Test Data Source Settings on a Flexcard (Managed Package)</a>.</p>
              <p>Supported property fields:</p>
              <ul>
                <li>
                  <p>Flyout action: Pass as an <strong class="uicontrol">Attribute</strong> to a child Flexcard, Custom LWC, and Omniscript</p>
                </li>

                <li>
                  <p>Custom LWC and child Flexcard elements: Pass as an <strong class="uicontrol">Attribute</strong>
                  </p>
                </li>

                <li>
                  <p>Block element: Display as a <strong class="uicontrol">Label</strong> when <strong class="uicontrol">Collapsible</strong> is enabled</p>
                </li>

                <li>
                  <p>Field element: Display as the <strong class="uicontrol">Output</strong>
                  </p>
                </li>

                <li>
                  <p>Text element: Display as plain text</p>
                </li>

              </ul>
            </td>

            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d112455e63 ">
              <p>
                <kbd>{objectApiName}</kbd>
              </p>
              <p style="margin-bottom:0;">For example, use an SOQL Query to get a list of accounts. Enter <kbd>{objectApiName}</kbd> as the object to query. Then add a <strong class="uicontrol">Test Parameter</strong> whose <strong class="uicontrol">Key</strong> is <kbd>ObjectApiName</kbd> and <strong class="uicontrol">Value</strong> is <kbd>Account</kbd>.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d112455e51 ">
              <p style="margin-bottom:0;">Params</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d112455e57 ">
              <p style="margin-bottom:0;">The page parameters passed to the URL.</p>
            </td>

            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d112455e63 ">
              <p>
                <kbd>{Params.fieldName}</kbd>
              </p>
              <p style="margin-bottom:0;">For example, <kbd>{Params.Id}</kbd> gets the context Id. We recommend using <kbd>{recordId}</kbd> to get the context Id of a record.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d112455e51 ">
              <p style="margin-bottom:0;">Parent</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d112455e57 ">
              <p style="margin-bottom:0;">Reference attributes from the parent Flexcard on the child Flexcard with this variable. Attributes are defined at design time on the parent Flexcard. See <a href="https://help.salesforce.com/s/articleView?id=xcloud.os_embed_flexcard_inside_another_flexcard.htm&amp;release=264.0.0&amp;type=5" title="For the managed package runtime, embed a reusable Flexcard as a child inside another Flexcard. The child Flexcard can have its own data source. Or, the parent can override the child's data source with its own data source. The parent can also pass specific data to the child, such as its recordId to use as the child's contextId.">Embed Flexcard Inside Another Flexcard (Managed Package)</a>.</p>
            </td>

            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d112455e63 ">
              <p>
                <kbd>{Parent.attributeName}</kbd>
              </p>
              <p style="margin-bottom:0;">For example, <kbd>Parent.Id</kbd> gets the <kbd>{Id}</kbd> attribute defined on the parent Flexcard.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d112455e51 ">
              <p style="margin-bottom:0;">recordId</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d112455e57 ">
              <p style="margin-bottom:0;">Gets the context Id of a Salesforce object's data record. Use Test Parameters to verify in Preview. See <a href="https://help.salesforce.com/s/articleView?id=xcloud.os_test_data_source_settings_on_a_flexcard.htm&amp;release=264.0.0&amp;type=5" title="For the managed package runtime, preview a Flexcard with real data by adding test values to runtime variables. The variables populate the dynamic fields in a data source, such as a contextId from an Omnistudio Data Mapper that gets data from an Account.">Test Data Source Settings on a Flexcard (Managed Package)</a>.</p>
            </td>

            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d112455e63 ">
              <p>
                <kbd>{recordId}</kbd>
              </p>
              <p style="margin-bottom:0;">For example, if using an Omnistudio Data Mapper to get a list of Account Cases, in the <strong class="uicontrol">Input Map</strong>, enter <kbd>AccountId</kbd> as <strong class="uicontrol">Key</strong> and <kbd>{recordId}</kbd> as the <strong class="uicontrol">Value</strong>. Then add a <strong class="uicontrol">Test Parameter</strong> whose <strong class="uicontrol">Key</strong> is <kbd>recordId</kbd> and <strong class="uicontrol">Value</strong> is <kbd>138238279r9ff</kbd> to populate your Flexcard with actual data.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d112455e51 ">
              <p style="margin-bottom:0;">records</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d112455e57 ">
              <p style="margin-bottom:0;">The records object of the Flexcard, which can be passed on to Child Flexcard, Custom LWC, and Flyout parameters.</p>
            </td>

            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d112455e63 ">
              <p>
                <kbd>{records}</kbd>
              </p>
              <p style="margin-bottom:0;">For example, <kbd>{records}</kbd> gets all records, while <kbd>{records [0]}</kbd> gets the first available record.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d112455e51 ">
              <p style="margin-bottom:0;">Session</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d112455e57 ">
              <p style="margin-bottom:0;">Variables used to store values from data sources and external systems, and hardcoded values. Properties are defined at design time on the Flexcard. See <a href="https://help.salesforce.com/s/articleView?id=xcloud.os_add_session_variables_to_a_flexcard.htm&amp;release=264.0.0&amp;type=5" title="For the managed package runtime, set attributes available from a component, or store values from data sources or external systems to access globally on a Flexcard. For example, set an API key or track pagination. Use the merge field {Session.var} to parse the value.">Add Session Variables to a Flexcard (Managed Package)</a>.</p>
            </td>

            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d112455e63 ">
              <p>
                <kbd>{Session.sessionkey}</kbd>
              </p>
              <p style="margin-bottom:0;">For example, <kbd>{Session.pageLimit}</kbd> gets a session variable named <kbd>pageLimit</kbd>.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d112455e51 ">
              <p style="margin-bottom:0;">User</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d112455e57 ">
              <p>User and Contact properties for the logged-in user.</p>
              <div class="slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium">
                <div class="slds-media slds-media_responsive">
                  <div class="slds-media__figure"><span class="slds-icon_container slds-icon_container_circle slds-icon-note-note"><img style="margin-bottom:0;" src="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" alt="Note"></span></div>
                  <div class="slds-media__body" style="padding-top:.5rem;padding-bottom:.5rem;"><span class="slds-text-title_caps">Note</span>
                    <p>Rendered User context variable is viewable at run time only. View in Preview.</p>
                  </div>
                </div>
              </div>
              <p>Available properties:</p>
              <ul>
                <li>
                  <p><code>userId</code>: User's Salesforce Id.</p>
                </li>

                <li>
                  <p><code>userAnLocale</code>: User's personal locale.</p>
                </li>

                <li>
                  <p><code>userSfLocale</code>: Salesforce org's locale.</p>
                </li>

                <li>
                  <p><code>userCurrency</code>: User's default currency.</p>
                </li>

                <li>
                  <p><code>userLanguage</code>: User's default
                    language.</p>
                </li>

                <li>
                  <p><code>userTimeZone</code>: User's timezone.</p>
                </li>

                <li>
                  <p><code>userName</code>: User's username.</p>
                </li>

                <li>
                  <p><code>userType</code>: User's license type.</p>
                </li>

                <li>
                  <p><code>userRole</code>: User's role.</p>
                </li>

                <li>
                  <p><code>userProfileName</code>: Profile name from the Profile lookup.</p>
                </li>

                <li>
                  <p><code>userProfileId</code>: Salesforce Id from the Profile lookup.</p>
                </li>

                <li>
                  <p><code>userAccountId</code>: Salesforce id from the Account lookup.</p>
                </li>

                <li>
                  <p><code>userContactId</code>: Salesforce id from the Contact lookup.</p>
                </li>

              </ul>
            </td>

            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d112455e63 ">
              <p>
                <kbd>{User.property}</kbd>
              </p>
              <p style="margin-bottom:0;">For example, <kbd>{User.userName}</kbd> gets the logged in user's username.</p>
            </td>

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

## Local Variables

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col>
          <col>
          <col>
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d112455e612">
              <p style="margin-bottom:0;">Name</p>
            </th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d112455e618">
              <p style="margin-bottom:0;">Description</p>
            </th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d112455e624">
              <p style="margin-bottom:0;">Merge Field</p>
            </th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d112455e612 ">
              <p style="margin-bottom:0;">action</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d112455e618 ">
              <p style="margin-bottom:0;">The parameters received by an event listener and sent to an action.</p>
            </td>

            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d112455e624 ">
              <p>
                <kbd>{action.parameter}</kbd>
              </p>
              <p style="margin-bottom:0;">For example, if your event is sending you a <kbd>contextId</kbd> parameter, then use <kbd>{action.contextId}</kbd>.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d112455e612 ">
              <p style="margin-bottom:0;">element</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d112455e618 ">
              <p>The values set by the toggle element and tied to an action.</p>
              <ul>
                <li>
                  <p>Checkbox Toggle type: element.checked</p>
                </li>

                <li>
                  <p>All other Toggle types: element.value</p>
                </li>

              </ul>
            </td>

            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d112455e624 ">
              <p style="margin-bottom:0;"><kbd>{element.value}</kbd>, <kbd>{element.checked}</kbd></p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d112455e612 ">
              <p style="margin-bottom:0;">record</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d112455e618 ">
              <p style="margin-bottom:0;">The record object that belongs to the State, and passed on to Child Flexcard, Custom LWC, and Flyout parameters.</p>
            </td>

            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d112455e624 ">
              <p><kbd>{record}</kbd>, <kbd>{record.FieldName}</kbd></p>
              <p style="margin-bottom:0;">For example, <kbd>{record}</kbd> gets the entire record, while <kbd>{record.Name}</kbd> gets the Name field from the record.</p>
            </td>

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