---
schema_version: "1"
id: d0cf7f069beceeb035f791dc1ffeb0bccc2cb9c2b87587f413e44622c20ebdae
title: Global Variables Resource
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/flow_ref_resources_global_variables.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.flow_ref_resources_global_variables.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 98d1b34df6c7d0416eb8b891ddb4741cd9b813e01b415efca945172ffc4e026e
description: System-provided variables store information that can be referenced throughout a flow. For example, it can contain information about the Salesforce org, flow, running user, or triggering record.
products:
  - Flow Builder
  - Salesforce Platform
release: "264"
---
# Global Variables Resource

System-provided variables store information that can be referenced throughout a flow. For example, it can contain information about the Salesforce org, flow, running user, or triggering record.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;"><a href="https://help.salesforce.com/s/articleView?id=platform.flow_ref_supported_editions.htm&amp;release=264.0.0&amp;type=5" title="Learn about the editions and user interfaces that support Flow Builder. Some Flow Builder features integrate with other Salesforce products that require additional licenses.">View supported editions.</a></td></tr></tbody></table>

This video explains what variables are and how flows use them to hold data.

View this [video](https://play.vidyard.com/MppqcKZd36p1YYX8iUruXi.html) in a separate tab.

This video explains variable types including common types, Boolean, Apex-defined, and collection variables.

View this [video](https://play.vidyard.com/Arao1M9qodyVTgW8myyU2J?) in a separate tab.

![Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-platform_automation-264-0-0-production-enus/60568438-ec7e-4665-acd1-7c80dcbe60d5/images/icon_example.png)

Example

Use `{!$User.Id}` to access the ID of the user who’s running the flow interview.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
      <colgroup>
        <col style="width:19.26782273603083%">
        <col style="width:19.26782273603083%">
        <col style="width:61.46435452793835%">
      </colgroup>
      <thead class="slds-text-title_caps ">
        <tr class="">
          <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d246683e99">Global Variable API Name</th>
          <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d246683e102"> Label </th>
          <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d246683e105">Description</th>
        </tr>
      </thead>
      <tbody>
        <tr class="">
          <td data-label="Global Variable API Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e99 ">
            <code>$Api</code>
          </td>

          <td data-label="Label" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e102 "><strong class="uicontrol">API</strong></td>

          <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e105 ">
            <p>The Session ID’s SOAP API endpoints. These merge fields are available.</p>
            <ul>
              <li><code>Enterprise_Server_URL_<var>xxx</var></code>—The Enterprise
                WSDL SOAP endpoint, where <var>xxx</var> represents the API version</li>

              <li><code>Partner_Server_URL_<var>xxx</var></code>—The Partner WSDL SOAP
                endpoint, where <var>xxx</var> represents the API version</li>

              <li><code>Session_ID</code></li>

            </ul>
          </td>

        </tr>
        <tr class="">
          <td data-label="Global Variable API Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e99 ">
            <code>$Client</code>
          </td>

          <td data-label="Label" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e102 "><strong class="uicontrol">Running User’s Client</strong></td>

          <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e105 ">The form factor of the running user’s device. Available only in Lightning
            Scheduler flows and supported only in Decision elements.
            <code>$Client.FormFactor</code> is automatically set to <code>Large</code>
            (computer), <code>Medium</code> (tablet), or <code>Small</code> (phone),
            depending on the device that’s running the flow. As you build a flow, use a Decision
            element to create separate outcomes for large, medium, and small devices. In each
            path, use screens that are optimized for that path’s device form factor.
          </td>

        </tr>
        <tr class="">
          <td data-label="Global Variable API Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e99 ">
            <code>$ContactPoints</code>
          </td>

          <td data-label="Label" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e102 "><strong class="uicontrol">Contact Points</strong></td>

          <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e105 ">
            <p>The contact points of the segment member. This variable is available only in
              segment-triggered flows and on-demand flows. These merge fields are available:</p>
            <ul>
              <li><code>Email</code></li>

              <li><code>Phone</code></li>

            </ul>
            <p>In segment triggered flows, this variable is available only if an activation
              template is selected. The contact point values are determined by the selected
              activation template. </p>
            <p style="margin-bottom:0;">In on-demand flows, this variable is always available.
              The contact values are determined by the values entered for the API input.
            </p>
          </td>

        </tr>
        <tr class="">
          <td data-label="Global Variable API Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e99 ">
            <code>$Event</code>
          </td>

          <td data-label="Label" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e102 "><strong class="uicontrol">$Event</strong></td>

          <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e105 ">The event that triggers an automation event-triggered flow to run, for example, a
            form submission. With this variable, you can access information about the event such
            as the event name.</td>

        </tr>
        <tr class="">
          <td data-label="Global Variable API Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e99 ">
            <code>$Flow</code>
          </td>

          <td data-label="Label" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e102 "><strong class="uicontrol">Running Flow Interview</strong></td>

          <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e105 ">The flow instance while it’s running. For details, see <a href="https://help.salesforce.com/s/articleView?id=platform.flow_ref_resources_system_variables.htm&amp;release=264.0.0&amp;type=5" title="In a flow, a $Flow global variable provides information about the running flow interview. Some variables contain system-provided values. You can update the other variables throughout the flow by using Assignments or by storing output values in the variables.">$Flow Global Variables Resource</a>.</td>

        </tr>
        <tr class="">
          <td data-label="Global Variable API Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e99 ">
            <code>$Input</code>
          </td>

          <td data-label="Label" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e102 "><strong class="uicontrol">$Input</strong></td>

          <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e105 ">Input data that’s provided from outside of a flow. The flow can reference inputs
            to perform logic and actions. For example, a prompt template in Prompt Builder sets
            the Recipient input to Mary Smith. The prompt template provides the Recipient input to
            the flow. The Recipient input is set to the Contact data type in the flow.To get Mary
            Smith's contact record by first name, configure the Get Records element to filter for
            contacts with the First Name field equal to the value for <code>$Input &gt; Recipient &gt;
                First Name</code>, which is Mary. Available only in the Prompt Flow process
            type.</td>

        </tr>
        <tr class="">
          <td data-label="Global Variable API Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e99 ">
            <code>$Label</code>
          </td>

          <td data-label="Label" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e102 "><strong class="uicontrol">Custom Label</strong></td>

          <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e105 ">
            <p>A label in a custom label file in your Salesforce org. This global variable
              appears only if your org has custom labels. </p>
            <p>The returned value depends on the
              language setting of the contextual user.​ Salesforce returns a value based on this
              order of precedence: </p>
            <ul>
              <li>The local translation’s text</li>

              <li>The packaged translation’s text</li>

              <li>The primary label’s text </li>

            </ul>
          </td>

        </tr>
        <tr class="">
          <td data-label="Global Variable API Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e99 ">
            <code>$Organization</code>
          </td>

          <td data-label="Label" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e102 "><strong class="uicontrol">Running Org</strong></td>

          <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e105 ">The Salesforce org where the flow is running. With this variable, you can access
            information like the organization’s name or address.</td>

        </tr>
        <tr class="">
          <td data-label="Global Variable API Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e99 ">
            <code>$Permission</code>
          </td>

          <td data-label="Label" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e102 "><strong class="uicontrol">Running User’s Permission</strong></td>

          <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e105 ">
            <span id="flow_ref_resources_global_variables__permission_var_description"><a name="flow_ref_resources_global_variables__permission_var_description"><!-- --></a>The custom permission access of the user running
              the flow. </span>
          </td>

        </tr>
        <tr class="">
          <td data-label="Global Variable API Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e99 ">
            <code>$Output</code>
          </td>

          <td data-label="Label" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e102 "><strong class="uicontrol">$Output</strong></td>

          <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e105 ">Output data from a flow that’s available inside or outside the flow. The flow can
            reference outputs to perform logic and actions. For example, a flow that’s associated
            with a prompt template in Prompt Builder can reference <code>$Output &gt;
                Prompt</code> to assign text to a field on a record. Outside the flow, an
            integrated app can merge the value that <code>$Output</code> references. For
            example, a prompt template merges the value of <code>$Output</code> into the
            prompt template’s resolution. Available only in the Prompt Flow process type.</td>

        </tr>
        <tr class="">
          <td data-label="Global Variable API Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e99 ">
            <code>$Profile</code>
          </td>

          <td data-label="Label" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e102 "><strong class="uicontrol">Running User Profile</strong></td>

          <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e105 ">
            <p>The profile of the user running the flow. With this variable, you can access
              information like the license type or name. </p>
            <ul>
              <li>Use profile names to reference standard profiles in <code>$Profile</code>
                merge fields. </li>

              <li>Users don’t need access to their profile information to run a flow that
                references these merge fields.</li>

            </ul>
          </td>

        </tr>
        <tr class="">
          <td data-label="Global Variable API Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e99 ">
            <code>$Record</code>
          </td>

          <td data-label="Label" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e102 "><strong class="uicontrol">Triggering</strong>
            <var>Object</var>, for example, <strong class="uicontrol">Triggering
              Account</strong>
          </td>

          <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e105 ">
            <p>The record that triggered the flow. Available only in autolaunched flows with
              triggers.</p>
            <p>In a record-triggered flow, the <code>$Record</code> global variable
              contains the triggering record’s values. You can reference and change
              <code>$Record</code> values throughout the flow.
            </p>
            <ul>
              <li>If the flow runs before the record is saved to the database, Salesforce
                automatically applies any changed <code>$Record</code> values to the record in
                the database.</li>

              <li>If the flow runs after the record is saved to the database, use an Update
                Records element to apply changed <code>$Record</code> values to the record in
                the database. </li>

            </ul>
            <p style="margin-bottom:0;">A schedule-triggered flow starts at the specified time and frequency for a
              batch of records. A flow interview runs for each record in the batch and stores all
              record’s field values in the <code>$Record</code> global variable. You can
              reference and change these values throughout the flow. In an Update Records element,
              you can use the ID and all field values from the <code>$Record</code> global
              variable. If you do, select <strong class="uicontrol">Filter inaccessible fields from flow
                requests</strong> in your org's process automation settings. Otherwise, the
              flow fails because the Update Records element tries to set the values for system
              fields and other read-only fields.</p>
          </td>

        </tr>
        <tr class="">
          <td data-label="Global Variable API Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e99 ">
            <code>$Record__Prior</code>
          </td>

          <td data-label="Label" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e102 "><strong class="uicontrol">Prior Values of Triggering</strong>
            <var>Object</var>, for example, <strong class="uicontrol">Prior Values of Triggering
              Account</strong>
          </td>

          <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e105 ">
            <p>The triggering record before a change triggered the flow. Available only in
              record-triggered flows configured to run when a record is updated or when a record is
              created or updated.</p>
            <p>The <code>$Record__Prior</code> global variable contains the
              values that the triggering record had immediately before the flow started. You can’t
              change these values in the flow.</p>
            <p>When a newly created record triggers the
              flow, all <code>$Record__Prior</code> values are null.</p>
            <p style="margin-bottom:0;">If the triggering
              record is created and updated in the same transaction,
              <code>$Record__Prior</code> contains the same values as
              <code>$Record</code>. This behavior occurs because no committed prior state
              exists when the update occurs. To capture pre-update field values in
              <code>$Record__Prior</code>, split the create and update operations into
              separate transactions in the automation that triggers the flow.
            </p>
          </td>

        </tr>
        <tr class="">
          <td data-label="Global Variable API Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e99 ">
            <code>$Setup</code>
          </td>

          <td data-label="Label" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e102 "><strong class="uicontrol">Custom Hierarchy Settings</strong></td>

          <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e105 ">
            <p>Your custom settings of type <code>hierarchy</code>. This global variable
              appears only if your org has custom hierarchy settings. You can access custom settings
              of type <code>list</code> only in Apex. </p>
            <p>With hierarchy custom settings, you can
              define values at these levels. Salesforce determines the correct value for this
              custom setting field based on the running user’s current context.</p>
            <ul>
              <li>Organization—The default value for everyone </li>

              <li>Profile—Overrides the Organization value </li>

              <li>User—Overrides the Organization and Profile values</li>

            </ul>
          </td>

        </tr>
        <tr class="">
          <td data-label="Global Variable API Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e99 ">
            <code>$System</code>
          </td>

          <td data-label="Label" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e102 "><strong class="uicontrol">System</strong></td>

          <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e105 ">The system’s OriginDateTime (<code>$System.OriginDateTime</code>), which
            represents the literal value of <samp>1900-01-01 00:00:00</samp>. Use
            this merge field to perform date/time offset calculations.</td>

        </tr>
        <tr class="">
          <td data-label="Global Variable API Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e99 ">
            <code>$User</code>
          </td>

          <td data-label="Label" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e102 "><strong class="uicontrol">Running User</strong></td>

          <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e105 ">
            <p>The user who’s running the flow interview. For example, reference the user’s ID
              or title.</p>
            <ul>
              <li>The running user is the person who caused the flow to start.</li>

              <li>When a flow is started because a Web-to-Case or Web-to-Lead process changed a
                record, the running user is the <code>Default Lead Owner</code> or
                <code>Default Case Owner</code>.
              </li>

            </ul>
            <p><code>$User.UITheme</code> and <code>$User.UIThemeDisplayed</code>
              identify the look and feel that the running user sees on a Salesforce page. The
              difference between the two variables is that <code>$User.UITheme</code> returns
              the configured look and feel for the user. <code>$User.UIThemeDisplayed</code>
              returns the actual look and feel for the user.</p>
            <p>For example, a user has the
              preference and permissions to see the Lightning Experience look and feel. However,
              they're using a browser, such as an older version of Internet Explorer, that doesn't
              support that look and feel. In this example, <code>$User.UITheme</code> and
              <samp class="parmname">$User.UIThemeDisplayed</samp> return different values.
            </p>
            <ul>
              <li><code>Theme1</code>—Obsolete Salesforce theme</li>

              <li><code>Theme2</code>—Salesforce Classic 2005 user interface theme</li>

              <li><code>Theme3</code>—Salesforce Classic 2010 user interface theme</li>

              <li><code>Theme4d</code>—Modern “Lightning Experience” Salesforce theme</li>

              <li><code>Theme4t</code>—Salesforce mobile app theme</li>

              <li><code>Theme4u</code>—Lightning Console theme</li>

              <li><code>PortalDefault</code>—Salesforce Customer Portal theme </li>

              <li><code>Webstore</code>—AppExchange theme</li>

            </ul>
          </td>

        </tr>
        <tr class="">
          <td data-label="Global Variable API Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e99 ">
            <code>$UserRole</code>
          </td>

          <td data-label="Label" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e102 "><strong class="uicontrol">Running User Role</strong></td>

          <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d246683e105 ">
            <p>The role of the user running the flow. For example, reference the role name or ID.</p>
            <ul>
              <li>The running user is the person who caused the flow to start.</li>

              <li>When a flow is started because a Web-to-Case or Web-to-Lead process changed a
                record, the running user is the <code>Default Lead Owner</code> or
                <code>Default Case Owner</code>.
              </li>

            </ul>
          </td>

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

## Global Variable Considerations for Flows

- `$Flow` is the only global variable available in screen component visibility conditions.
- In a record-triggered flow, the `$Record` global variable doesn’t contain the triggering record’s values for fields that derive their values from other records. Examples of derived fields include `Contact.Name` and `User.MediumPhotoUrl`.
- Multi-select picklist, time, and location global variables are available only in formulas.
- If a field in the database has no value, the corresponding merge field returns a blank value. For example, if your org's Country field has no value, `{!$Organization.Country}` returns no value.
- `$Label` global variables take longer to load in the flow resource selection list. When selecting a `$Label` global variable, if the `$Label` option isn’t visible in the flow resource selection list, close the window and try again in a few minutes.

#### See Also

- [Flow Operations and Read-Only Fields](https://help.salesforce.com/s/articleView?id=platform.flow_considerations_readonlyfields_parent.htm&release=264.0.0&type=5 "Understand when flows have read-only access to field values. You can control the behavior when a flow tries to update a read-only field and remove read-only field values from flow operations.")
- [Salesforce Data Considerations for Flows](https://help.salesforce.com/s/articleView?id=platform.flow_considerations_salesforce_data.htm&release=264.0.0&type=5 "When designing flows, keep these Salesforce data considerations in mind.")
- [Process Automation Settings](https://help.salesforce.com/s/articleView?id=platform.automation_about_settings.htm&release=264.0.0&type=5 "Salesforce provides various settings for platform automation to help customize and streamline business processes.")