Loading
Salesforce now sends email only from verified domains. Read More
Automate Your Business Processes
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Global Variables Resource

          Global Variables Resource

          A system-provided variable holds information that can be referenced throughout the flow. For example, it can contain information about the Salesforce org, flow, running user, or triggering record.

          Required Editions

          View supported editions.

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

          View this video in a separate tab.

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

          View this video in a separate tab.

          Example
          Example

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

          Global Variable API Name Label Description
          $Api API

          The Session ID’s SOAP API endpoints. These merge fields are available.

          • Enterprise_Server_URL_xxx—The Enterprise WSDL SOAP endpoint, where xxx represents the API version.
          • Partner_Server_URL_xxx—The Partner WSDL SOAP endpoint, where xxx represents the API version.
          • Session_ID
          $Client Running User’s Client The form factor of the running user’s device. Available only in Lightning Scheduler flows and supported only in Decision elements. $Client.FormFactor is automatically set to Large (computer), Medium (tablet), or Small (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.
          $ContactPoints Contact Points

          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:

          • Email
          • Phone

          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.

          In on-demand flows, this variable is always available. The contact values are determined by the values entered for the API input.

          $Event $Event 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.
          $Flow Running Flow Interview The flow instance while it’s running. For details, see $Flow Global Variables Resource.
          $Input $Input 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 retrieve Mary Smith’s contact record by first name, the Get Records element filters for contacts with the First Name field equal to the value for $Input > Recipient > First Name, which is Mary. Available only in the Prompt Flow process type.
          $Label Custom Label

          A label in a custom label file in your Salesforce org. This global variable appears only if your org has custom labels.

          The returned value depends on the language setting of the contextual user.​ The value returned is one of the following, in order of precedence:

          • The local translation’s text
          • The packaged translation’s text
          • The primary label’s text
          $Organization Running Org The Salesforce org where the flow is running. With this variable, you can access information like the organization’s name or address.
          $Permission Running User’s Permission The custom permission access of the user running the flow.
          $Output $Output 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 $Output > Prompt to assign text to a field on a record. Outside the flow, an integrated app can merge the value that’s referenced by $Output. For example, a prompt template merges the value of $Output into the prompt template’s resolution. Available only in the Prompt Flow process type.
          $Profile Running User Profile

          The profile of the user running the flow. With this variable, you can access information like the license type or name.

          • Use profile names to reference standard profiles in $Profile merge fields.
          • Users don’t need access to their profile information to run a flow that references these merge fields.
          $Record Triggering Object, for example, Triggering Account

          The record that triggered the flow. Available only in autolaunched flows with triggers.

          In a record-triggered flow, the $Record global variable contains the triggering record’s values. You can reference and change $Record values throughout the flow.

          • If the flow runs before the record is saved to the database, Salesforce automatically applies any changed $Record values to the record in the database.
          • If the flow runs after the record is saved to the database, use an Update Records element to apply changed $Record values to the record in the database.

          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 of the record’s field values in the $Record global variable. You can reference and change these values throughout the flow. If you configure an Update Records element to use the ID and all field values from the $Record global variable, enable Filter inaccessible fields from flow requests 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.

          $Record__Prior Prior Values of Triggering Object, for example, Prior Values of Triggering Account

          The triggering record before a change triggered the flow. Available only in record-triggered flows that are configured to run when a record is updated or when a record is created or updated.

          The $Record__Prior global variable contains the values that the triggering record had immediately before the flow started. You can’t change these values in the flow.

          When the flow is triggered by a newly created record, all $Record__Prior values are null.

          $Setup Custom Hierarchy Settings

          Your custom settings of type hierarchy. This global variable appears only if your org has custom hierarchy settings. You can access custom settings of type list only in Apex.

          Hierarchical custom settings allow values at these levels. Salesforce determines the correct value for this custom setting field based on the running user’s current context.

          • Organization—The default value for everyone
          • Profile—Overrides the Organization value
          • User—Overrides the Organization and Profile values
          $System System The system’s OriginDateTime ($System.OriginDateTime), which represents the literal value of 1900-01-01 00:00:00. Use this merge field to perform date/time offset calculations.
          $User Running User

          The user who’s running the flow interview. For example, reference the user’s ID or title.

          • The running user is the person who caused the flow to start.
          • When a flow is started because a Web-to-Case or Web-to-Lead process changed a record, the running user is the Default Lead Owner or Default Case Owner.

          $User.UITheme and $User.UIThemeDisplayed identify the look and feel that the running user sees on a Salesforce page. The difference between the two variables is that $User.UITheme returns the look and feel the user is supposed to see, while $User.UIThemeDisplayed returns the look and feel the user actually sees. For example, a user can have the preference and permissions to see the Lightning Experience look and feel, but if they’re using a browser that doesn’t support that look and feel, for example, older versions of Internet Explorer, $User.UIThemeDisplayed returns a different value. These merge fields return one of these values.

          • Theme1—Obsolete Salesforce theme
          • Theme2—Salesforce Classic 2005 user interface theme
          • Theme3—Salesforce Classic 2010 user interface theme
          • Theme4d—Modern “Lightning Experience” Salesforce theme
          • Theme4t—Salesforce mobile app theme
          • Theme4u—Lightning Console theme
          • PortalDefault—Salesforce Customer Portal theme
          • Webstore—AppExchange theme
          $UserRole Running User Role

          The role of the user running the flow. For example, reference the role name or ID.

          • The running user is the person who caused the flow to start.
          • When a flow is started because a Web-to-Case or Web-to-Lead process changed a record, the running user is the Default Lead Owner or Default Case Owner.

          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 whose values are derived 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 no value is set for your org’s Country field, {!$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.
           
          Loading
          Salesforce Help | Article