Loading
Prepare for Email to Become the Default Login ExperienceRead More
Intermittent freezing when using using certain browser versionsRead More
Automate Your Business Processes with Salesforce Flow
Global Variables Flow Orchestration Resource

Global Variables Flow Orchestration Resource

Use system-provided variables that reference information about the Salesforce org or running user, such as the user’s ID or the API session ID.

Required Editions

View supported editions for Flow Orchestration.
Global Variable LABEL Description
$Api API

References an API URL or the session ID. 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
$Flow Running Flow Interview References information about the running flow interview. For details, see $Flow Global Variables Flow Orchestration Resource.
$Label Custom Label

References custom labels. This global variable appears only if your org has custom labels.

The returned value depends on the language setting of the contextual user.​ Salesforce returns a value based on this order of precedence:

  • The local translation’s text
  • The packaged translation’s text
  • The primary label’s text
$Orchestration Current Orchestration Run References the current orchestration instance.
$Organization Running Org References information about your company.
$Permission Running User’s Permission References information about the current user’s custom permission access.
$Profile Running User Profile

References information from the current user’s profile, such as 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

Available only in record-triggered orchestrations.

In a record-triggered orchestration, the orchestration makes a copy of the triggering record when it starts. If a step within that orchestration makes a field update on the triggering record, it’s not reflected in the $Record global variable. To make field updates on the orchestration-triggering record, pass the record ID to the step’s flow. Then use the ID in a Get Records element.

You can reference $Record values throughout the orchestration by passing the variable as an input parameter to a flow in a step.

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

Available only in record-triggered orchestrations 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 orchestration started. You can’t change these values in the orchestration or with any flows associated with its steps.

When a newly created record triggers the orchestration, all $Record__Prior values are null.

If the triggering record is created and updated in the same transaction, $Record__Prior contains the same values as $Record. This behavior occurs because no committed prior state exists when the update occurs. To capture pre-update field values in $Record__Prior, split the create and update operations into separate transactions in the automation that triggers the orchestration.

$Setup Custom Hierarchy Settings

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

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.

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

References information about the user who’s running the orchestration.

Most of the time, an orchestration’s running user is the automated process user. When the running user is the automated process user, $User doesn’t provide useful information.

$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 configured look and feel for the user. $User.UIThemeDisplayed returns the actual look and feel for the user.

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, $User.UITheme and $User.UIThemeDisplayed return different 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 References information about the current user’s role, such as the role name or ID.

Global Variable Considerations for Orchestrations

  • In a record-triggered orchestration, 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.
  • $Flow Global Variables Flow Orchestration Resource
    A $Flow global variable provides information about the running orchestration. Some variables contain system-provided values. You can update the other variables throughout the orchestration by storing output values in the variables.
 
Loading
Salesforce Help | Article