Reference Global Variables in a Flow

Visual Workflow now supports a subset of Salesforce global variables. Reference a global variable to access information about your organization or the user who’s running flow without using a query. Previously, you could access some of this information through lookup elements. However, unlike lookup elements, global variables don’t count against SOQL query limits.
The following global variables and their merge fields are available in flow formulas.
  • $Api
  • $Label—available only if custom labels exist in your organization
  • $Organization
  • $Permission—available only if custom permissions exist in your organization
  • $Profile
  • $Setup—available only if hierarchy custom settings exist in your organization
  • $System
  • $User
  • $UserRole
To add a global variable to a flow formula from the Cloud Flow Designer, open the Resources drop-down list and expand the GLOBAL AND SYSTEM VARIABLES section.

Example

Your flow greets the user who’s running the flow by name.

Before, you would add ?userId={!User.Id} to the end of the flow URL and then reference that ID in a Record Lookup to get the FirstName and LastName field values.

With global variables, you instead create a formula with the following expression.

{!$User.FirstName} & " " & {!$User.LastName}