---
schema_version: "1"
id: fb47c0cda128f25ee32a9e69ed9b2550179f8d5e74dd772c7f4f106c7f8dbbb6
title: Flexcards Context Variables
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_42922.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_flexcards_context_variables_42922.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 15e19a1363e27ed9a46cbdf6cd6de256415543312263550c223a43865d888d4d
description: To provide context to data sources, actions, and other components, add global and local context variables to a Flexcard. All variables are case-sensitive.
products:
  - Omnistudio
release: "264"
---
# Flexcards Context Variables

To provide context to data sources, actions, and other components, add global and local context variables to a Flexcard. All variables are case-sensitive.

## 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="d110228e40">
              <p style="margin-bottom:0;">Name</p>
            </th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d110228e46">
              <p style="margin-bottom:0;">Description</p>
            </th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d110228e52">
              <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="d110228e40 ">
              <p style="margin-bottom:0;">Label</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d110228e46 ">
              <p style="margin-bottom:0;">Salesforce Custom Labels. </p>
            </td>

            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d110228e52 ">
              <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="d110228e40 ">
              <p style="margin-bottom:0;">objectApiName</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d110228e46 ">
              <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_37522.htm&amp;release=264.0.0&amp;type=5" title="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</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: Show as a <strong class="uicontrol">Label</strong> when
                    <strong class="uicontrol">Collapsible</strong> is enabled
                  </p>
                </li>

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

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

              </ul>
            </td>

            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d110228e52 ">
              <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="d110228e40 ">
              <p style="margin-bottom:0;">Params</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d110228e46 ">
              <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="d110228e52 ">
              <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="d110228e40 ">
              <p style="margin-bottom:0;">Parent</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d110228e46 ">
              <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_29030.htm&amp;release=264.0.0&amp;type=5" title="Share data between Flexcards by embedding a Flexcard as a child in another Flexcard. The child Flexcard can have its 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 record ID to use as the child's context ID.">Embed Flexcard in a Flexcard</a>.</p>
            </td>

            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d110228e52 ">
              <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="d110228e40 ">
              <p style="margin-bottom:0;">recordId</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d110228e46 ">
              <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_37522.htm&amp;release=264.0.0&amp;type=5" title="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</a>.</p>
            </td>

            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d110228e52 ">
              <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="d110228e40 ">
              <p style="margin-bottom:0;">records</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d110228e46 ">
              <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="d110228e52 ">
              <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="d110228e40 ">
              <p style="margin-bottom:0;">Session</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d110228e46 ">
              <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_set_up_a_flexcard_in_the_flexcard_designer_37646.htm&amp;release=264.0.0&amp;type=5" title="Specify your Flexcard’s behavior with the setup options. For example, add or update a data source, create an event listener, or add session variables.">Configure Flexcard Settings</a>.</p>
            </td>

            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d110228e52 ">
              <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="d110228e40 ">
              <p style="margin-bottom:0;">User</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d110228e46 ">
              <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-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/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 only at run time. 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="d110228e52 ">
              <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="d110228e585">
              <p style="margin-bottom:0;">Name</p>
            </th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d110228e591">
              <p style="margin-bottom:0;">Description</p>
            </th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d110228e597">
              <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="d110228e585 ">
              <p style="margin-bottom:0;">action</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d110228e591 ">
              <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="d110228e597 ">
              <p>
                <kbd>{action.parameter}</kbd>
              </p>
              <p>For example, if your event is sending you a
                <kbd>contextId</kbd> parameter, then use
                <kbd>{action.contextId}</kbd>.
              </p>
              <p style="margin-bottom:0;">To send parameters to an action from a data table, use the
                <kbd>{action.result.X}</kbd> format, where X represents
                any field name defined within the data source.
              </p>
            </td>

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

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d110228e591 ">
              <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="d110228e597 ">
              <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="d110228e585 ">
              <p style="margin-bottom:0;">record</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d110228e591 ">
              <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="d110228e597 ">
              <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>