---
schema_version: "1"
id: 6a77108fee1036b45af29901d56fce10f081483b37feed5f7da9f43925040f88
title: Global Variables
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/dev_understanding_global_variables.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.dev_understanding_global_variables.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 7aaad9032e2a1048c6e362e8080e05b69ad9a826deb63ebcf059b49c4763d3ff
description: When you work with components such as custom buttons and links, formulas in custom fields, validation rules, flows, processes, and Visualforce pages, you can use special merge fields to reference data in Salesforce.
products:
  - Salesforce Platform
release: "264"
---
# Global Variables

When you work with components such as custom buttons and links, formulas in custom fields, validation rules, flows, processes, and Visualforce pages, you can use special merge fields to reference data in Salesforce.

### 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;">The availability of each global variable depends on the experience and edition requirements for the related feature.</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="vertical-align:top;" id="d16337e54">User Permissions
              Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e54 ">To create, edit, and delete custom s-controls, formulas, or
              Visualforce pages:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e54 ">Customize Application</td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e54 ">To edit flows and processes:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e54 ">Manage Flow</td>

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

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_code-264-0-0-production-enus/789bc523-706b-4ae4-8fe9-be6322e38b6b/images/icon_note.png)

Note Web tabs support only $User, $Organization, and $Api merge fields.

Use these global variables when choosing a merge field type to add to your custom component:

## $Action

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:18.148820326678766%">
          <col style="width:81.85117967332123%">
        </colgroup>
        <tbody>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Description: </td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <span id="dev_understanding_global_variables__action_var_descr"><a name="dev_understanding_global_variables__action_var_descr"><!-- --></a>A global merge field type to use when
                referencing standard Salesforce actions, such as displaying the
                Accounts tab home page, creating accounts, editing accounts, and
                deleting accounts.</span>
              <span>Use action merge fields in <code>LINKTO</code> and <code>URLFOR</code> functions to reference the action
                selected.</span>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Use: </td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <ul>
                <li>Select the field type: $Action.</li>

                <li>Insert a merge field in the format
                  <samp class="parmname">$Action.object.action</samp>, such as
                  <samp class="parmname">$Action.Account.New</samp>.
                </li>

              </ul>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">S-Control Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <p>This s-control references the standard action for creating
                accounts in the <samp class="parmname">$Action.Account.New</samp> merge
                field.</p>
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-html">&lt;html&gt;
    &lt;body&gt;
        {!LINKTO(
            "Create a New Account", 
            $Action.Account.New, 
            $ObjectType.Account
         )}
    &lt;/body&gt;
&lt;/html&gt;</code></pre>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Visualforce Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-markup">&lt;apex:outputLink value="{!URLFOR($Action.Account.New)}"&gt;
    Create New Account
&lt;/apex:outputLink&gt;</code></pre>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Tips:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">This global variable is only available for custom buttons and
              links, s-controls, and Visualforce pages.</td>

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

All objects support basic actions, such as new, clone, view, edit, list, and delete. The $Action global also references actions available on many standard objects. The values available in your organization can differ depending on the features you enable.

## $Api

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:15.455950540958268%">
          <col style="width:69.08809891808346%">
          <col style="width:15.455950540958268%">
        </colgroup>
        <tbody>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Description: </td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <span id="dev_understanding_global_variables__api_var_descr"><a name="dev_understanding_global_variables__api_var_descr"><!-- --></a>A global merge field type to use when
                referencing API URLs.</span>
            </td>

            <td class="slds-cell-wrap" style="vertical-align:top;">&nbsp;</td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Use: </td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <ul>
                <li>Select the field type: $Api. </li>

                <li>Select a merge field, such as:<ul>
                    <li><samp class="parmname">$Api.Enterprise_Server_URL__xxx</samp>:
                      The Enterprise WSDL SOAP endpoint where
                      <samp class="parmname">xxx</samp> represents the version of
                      the API. For example,
                      <samp class="parmname">$Api.Enterprise_Server_URL_140</samp>
                      is the merge field value for version 14.0 of the
                      API.
                    </li>
                    <li><samp class="parmname">$Api.Partner_Server_URL__xxx</samp>:
                      The Partner WSDL SOAP endpoint where
                      <samp class="parmname">xxx</samp> represents the version of
                      the API.
                    </li>
                    <li><samp class="parmname">$Api.Session_ID</samp>: The session
                      ID.</li>
                  </ul>
                </li>

              </ul>
            </td>

            <td class="slds-cell-wrap" style="vertical-align:top;">&nbsp;</td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">S-Control Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <p>This custom formula field calls a service to replace the SIC
                code. Replace <var>myserver</var> with the name of your
                server.</p>
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>HYPERLINK("https://www.myserver.com/mypage.jsp" &amp; 
"?Username="       &amp; $User.Username &amp; 
"&amp;crmSessionId="   &amp; GETSESSIONID() &amp; 
"&amp;crmServerUrl="   &amp;  $Api.Partner_Server_URL_90  &amp;
"&amp;crmObjectId="    &amp; Id &amp;
"&amp;crmFieldUpdate=sicCode",
"Update SIC Code")</code></pre>
            </td>

            <td class="slds-cell-wrap" style="vertical-align:top;">&nbsp;</td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Visualforce and Flow Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <p>Use dot notation to return the session ID.
              </p>
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>{!$Api.Session_ID}</code></pre>
            </td>

            <td class="slds-cell-wrap" style="vertical-align:top;">&nbsp;</td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Tips:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <p>This global variable is only available for formula fields,
                s-controls, custom buttons and links, Visualforce pages, flows, and
                process formulas.</p>
              <p><code>$Api.Session_ID</code> and <code>GETSESSIONID()</code> return the same value, an
                identifier for the current session in the current context. This
                context varies depending on where the global variable or
                function is evaluated. For example, if you use either in a
                custom formula field and that field is displayed on a standard
                page layout in Salesforce Classic, the referenced session is a
                basic Salesforce session. That same field (or the underlying
                variable or formula result), when used in a Visualforce page,
                references a Visualforce session instead.</p>
              <p>Session contexts
                are based on the domain of the request. That is, the session
                context changes whenever you cross a hostname boundary, such as
                from <samp class="filepath">.salesforce.com</samp> to
                <samp class="filepath">.vf.force.com</samp> or
                <samp class="filepath">.lightning.force.com</samp>.
              </p>
              <p>Session
                identifiers from different contexts, and the sessions
                themselves, are different. When you transition between contexts,
                the old session is replaced by the new one, and the old session
                is no longer valid. The session ID also changes at this
                time.</p>
              <p>Normally Salesforce transparently handles session
                hand-off between contexts, but if you’re passing the session ID
                around yourself, you might need to re-access <code>$Api.Session_ID</code> or <code>GETSESSIONID()</code> from the new
                context to ensure a valid session ID.</p>
              <p style="margin-bottom:0;">Not all sessions are
                created equal. In particular, sessions obtained in a Lightning
                Experience
                context
                have reduced privileges and don't have API access. You can't use
                these session IDs to make API calls. <code>{!$Api.Session_ID}</code> isn’t generated for guest
                users.</p>
            </td>

            <td class="slds-cell-wrap" style="vertical-align:top;">&nbsp;</td>

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

## $Component

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:18.484288354898336%">
          <col style="width:81.51571164510166%">
        </colgroup>
        <tbody>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">
              <strong>Description:</strong>
            </td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <span id="dev_understanding_global_variables__component_var_descr"><a name="dev_understanding_global_variables__component_var_descr"><!-- --></a>A global merge field type to use
                when referencing a Visualforce component.</span>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Use:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <span id="dev_understanding_global_variables__component_var_use"><a name="dev_understanding_global_variables__component_var_use"><!-- --></a>Each component in a Visualforce page
                has its own <code>Id</code> attribute.
                When the page is rendered, this attribute is used to generate
                the Document Object Model (DOM) ID. Use <code>$Component.<var>Path.to.Id</var></code> in
                JavaScript to reference a specific component on a page, where
                <var>Path.to.Id</var> is a component hierarchy
                specifier for the component being referenced.</span>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Visualforce Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-javascript">function beforeTextSave() {
    document.getElementById('{!$Component.msgpost}').value = myEditor.getEditorHTML();
}
</code></pre>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Tips:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">This global variable is only available for Visualforce
              pages.</td>

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

## $ComponentLabel

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:18.484288354898336%">
          <col style="width:81.51571164510166%">
        </colgroup>
        <tbody>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Description:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <span id="dev_understanding_global_variables__componentLabel_var_desc"><a name="dev_understanding_global_variables__componentLabel_var_desc"><!-- --></a>A global merge field to use when
                referencing the label of an <code>inputField</code> component on a Visualforce page that is
                associated with a message.</span>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Use:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <span id="dev_understanding_global_variables__componentLabel_var_use"><a name="dev_understanding_global_variables__componentLabel_var_use"><!-- --></a>Return the label of an <code>inputField</code> component that
                is associated with a message.</span>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Visualforce Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x" id="dev_understanding_global_variables__componentLabel_var_example"><a name="dev_understanding_global_variables__componentLabel_var_example"><!-- --></a><code class="language-markup">&lt;apex:datalist var="mess" value="{!messages}"&gt;
    &lt;apex:outputText value="{!mess.componentLabel}:" style="color:red"/&gt;
    &lt;apex:outputText value="{!mess.detail}" style="color:black" /&gt;
&lt;/apex:datalist&gt;
</code></pre>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Tips:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">This global variable is only available for Visualforce
              pages.</td>

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

## $CurrentPage

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:19%">
          <col style="width:81%">
        </colgroup>
        <tbody>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Description:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <span id="dev_understanding_global_variables__currentpageref_var_descr"><a name="dev_understanding_global_variables__currentpageref_var_descr"><!-- --></a>A global merge field type to
                use when referencing the current Visualforce page or page
                request.</span>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Use:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <span id="dev_understanding_global_variables__currentpageref_var_use"><a name="dev_understanding_global_variables__currentpageref_var_use"><!-- --></a>Use this global variable in a
                Visualforce page to reference the current page name (<code>$CurrentPage.Name</code>) or the URL
                of the current page (<code>$CurrentPage.URL)</code>. Use <code>$CurrentPage.parameters.<var>parameterName</var></code>
                to reference page-request parameters and values, where
                <var>parameterName</var> is the request parameter
                being referenced. <var>parameterName</var> isn't
                case-sensitive.</span>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Visualforce Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x" id="dev_understanding_global_variables__currentpageref_var_example"><a name="dev_understanding_global_variables__currentpageref_var_example"><!-- --></a><code class="language-markup">&lt;apex:page standardController="Account"&gt;
    &lt;apex:pageBlock title="Hello {!$User.FirstName}!"&gt;
        You belong to the {!account.name} account.&lt;br/&gt;
        You're also a nice person.
    &lt;/apex:pageBlock&gt;
    &lt;apex:detail subject="{!account}" relatedList="false"/&gt;
    &lt;apex:relatedList list="OpenActivities" 
        subject="<strong>{!$CurrentPage.parameters.relatedId}</strong>"/&gt; 
&lt;/apex:page&gt;</code></pre>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Tips:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">This global variable is only available for Visualforce
              pages.</td>

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

## $CustomMetadata

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small "><colgroup><col style="width:18.281535648994517%"> <col style="width:81.71846435100548%"></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Description:</td><td class="slds-cell-wrap" style="vertical-align:top;"><span id="dev_understanding_global_variables__cmt_var_descr"><a name="dev_understanding_global_variables__cmt_var_descr"></a>A custom metadata record. Available in API version 43.0 and later.</span></td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Use:</td><td class="slds-cell-wrap" style="vertical-align:top;">Use this global variable in validation rule formulas to dynamically reference custom metadata types using the syntax <code>$CustomMetadata.<var>type</var>.<var>record</var>.<var>field</var></code>.</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Tips:</td><td class="slds-cell-wrap" style="vertical-align:top;">This global variable only supports validation rule formulas.</td></tr></tbody></table>

## $FieldSet

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:19%">
          <col style="width:81%">
        </colgroup>
        <tbody>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Description:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <span id="dev_understanding_global_variables__fieldset_var_descr"><a name="dev_understanding_global_variables__fieldset_var_descr"><!-- --></a>Provides access to a field set defined in your
                organization.</span>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Use:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <span id="dev_understanding_global_variables__fieldset_var_use"><a name="dev_understanding_global_variables__fieldset_var_use"><!-- --></a>Use this in your Visualforce pages to dynamically iterate
                over fields in a field set. You must prefix this global variable with a reference
                to the standard or custom object that has the field set.</span>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Visualforce Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x" id="dev_understanding_global_variables__fieldset_var_example"><a name="dev_understanding_global_variables__fieldset_var_example"><!-- --></a><code class="language-markup">&lt;apex:page standardController="Account"&gt;
    &lt;apex:repeat value="{!$ObjectType.Account.FieldSets.myFieldSetName}" var="field"&gt;
        &lt;apex:outputText value="{!field}" /&gt;
    &lt;/apex:repeat&gt;
&lt;/apex:page&gt;</code></pre>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Tips:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">This global variable is only available for Visualforce pages.</td>

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

## $Label

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:19.011406844106464%">
          <col style="width:80.98859315589354%">
        </colgroup>
        <tbody>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Description:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <span id="dev_understanding_global_variables__label_var_descr"><a name="dev_understanding_global_variables__label_var_descr"><!-- --></a>A global merge field type to use when
                referencing a custom label.</span>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Use:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <ul>
                <li>Select the field type $Label.</li>

                <li>Select the custom label that you want to reference.</li>

              </ul>
              <p>
                <span id="dev_understanding_global_variables__label_var_use1"><a name="dev_understanding_global_variables__label_var_use1"><!-- --></a>The returned value depends on the
                  language setting of the contextual user.​ The value returned is
                  one of these, in order of precedence:</span>
              </p><a name="dev_understanding_global_variables__label_var_use2"><!-- --></a>
              <ul id="dev_understanding_global_variables__label_var_use2">
                <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 class="slds-cell-wrap" style="vertical-align:top;">Flow Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <p>Create a flow formula whose expression is:
              </p>
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>{!$Label.customCurrency_label}</code></pre>
              <p style="margin-bottom:0;">Then
                reference that flow formula as the label of a screen
                component.</p>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Visualforce Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x" id="dev_understanding_global_variables__label_var_example"><a name="dev_understanding_global_variables__label_var_example"><!-- --></a><code class="language-markup">&lt;apex:page&gt;
    &lt;apex:pageMessage severity="info" 
        strength="1" 
        summary="{!$Label.firstrun_helptext}" 
    /&gt;
&lt;/apex:page&gt;</code></pre>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Aura Components Example</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <dl>

                <dt style="font-weight:bold;padding-top:.25rem;">Label in a markup expression using the default
                  namespace</dt>

                <dd style="padding-left:1.5rem;padding-bottom:.5rem;">
                  <code>{!$Label.c.<var>labelName</var>}</code>
                </dd>
                <dd style="padding-left:1.5rem;padding-bottom:.5rem;">Label expressions in markup are supported in
                  <samp class="filepath">.cmp</samp> and
                  <samp class="filepath">.app</samp> resources only.
                </dd>


                <dt style="font-weight:bold;padding-top:.25rem;">Label in JavaScript code if your org has a
                  namespace</dt>

                <dd style="padding-left:1.5rem;padding-bottom:.5rem;">
                  <code>$A.get("$Label.<var>namespace</var>.<var>labelName</var>")</code>
                </dd>

              </dl>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Tips:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">This global variable is available for Aura components,
              Visualforce pages, Apex, flows, and process formulas only.</td>

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

## $Label.Site

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:19%">
          <col style="width:81%">
        </colgroup>
        <tbody>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Description:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <span id="dev_understanding_global_variables__LabelSiteDescription"><a name="dev_understanding_global_variables__LabelSiteDescription"><!-- --></a>A global merge field type used to
                reference a standard Sites label in a Visualforce page. As with
                all standard labels, the label’s message displays according to
                the user’s language and locale. You can’t modify the
                message of a standard Sites label. To use a custom message,
                create a custom label, and then reference the label with the
                <samp class="parmname">$Label</samp> global variable.</span>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Use:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <span id="dev_understanding_global_variables__LabelSiteUse1"><a name="dev_understanding_global_variables__LabelSiteUse1"><!-- --></a>Use this expression in a Visualforce page to access a
                standard Sites label. When the application server constructs the page to be
                presented to the end-user’s browser, the value returned depends on the language
                and locale of the user.</span>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Visualforce Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x" id="dev_understanding_global_variables__LabelSiteExample"><a name="dev_understanding_global_variables__LabelSiteExample"><!-- --></a><code class="language-markup">&lt;apex:page&gt;
    &lt;apex:pageMessage severity="info" 
        strength="1" 
        summary="{!$Label.Site.temp_password_sent}" 
    /&gt;
&lt;/apex:page&gt;</code></pre>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Tips:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">This global variable is only available for Visualforce
              pages.</td>

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

Salesforce provides these labels:

 
| Label | Message |
| --- | --- |
| authorization\_required | Authorization Required |
| bandwidth\_limit\_exceeded | Bandwidth Limit Exceeded |
| change\_password | Change Password |
| change\_your\_password | Change Your Password |
| click\_forget\_password | If you have forgotten your password, click Forgot Password to reset it. |
| community\_nickname | Nickname |
| confirm\_password | Confirm Password |
| down\_for\_maintenance | <i>{0}</i> is down for maintenance |
| email | Email |
| email\_us | email us |
| enter\_password | Did you forget your password? Please enter your username below. |
| error | Error: {0} |
| error2 | Error |
| file\_not\_found | File Not Found |
| forgot\_password | Forgot Password |
| forgot\_password\_confirmation | Forgot Password Confirmation |
| forgot\_your\_password\_q | Forgot Your Password? |
| get\_in\_touch | Please <a href="https://help.salesforce.com/s/%7B0%7D">{1}</a> if you need to get in touch. |
| go\_to\_login\_page | Go to Login Page |
| img\_path | /img/sites |
| in\_maintenance | Down For Maintenance |
| limit\_exceeded | Limit Exceeded |
| login | Login |
| login\_button | Login |
| login\_or\_register\_first | You must first log in or register before accessing this page. |
| logout | Logout |
| new\_password | New Password |
| new\_user\_q | New User? |
| old\_password | Old Password |
| page\_not\_found | Page Not Found |
| page\_not\_found\_detail | Page Not Found: {0} |
| password | Password |
| passwords\_dont\_match | Passwords did not match. |
| powered\_by | Powered by |
| register | Register |
| registration\_confirmation | Registration Confirmation |
| site\_login | Site Login |
| site\_under\_construction | Site Under Construction |
| sorry\_for\_inconvenience | Sorry for the inconvenience. |
| sorry\_for\_inconvenience\_back\_shortly | Sorry for the inconvenience. We'll be back shortly. |
| stay\_tuned | Stay tuned. |
| submit | Submit |
| temp\_password\_sent | An email has been sent to you with your temporary password. |
| thank\_you\_for\_registering | Thank you for registering. An email has been sent to you with your temporary password. |
| under\_construction | <i>{0}</i> is under construction |
| user\_registration | New User Registration |
| username | Username |
| verify\_new\_password | Verify New Password |

## $Network

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:19.011406844106464%">
          <col style="width:80.98859315589354%">
        </colgroup>
        <tbody>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Description:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <span id="dev_understanding_global_variables__network_var_descr"><a name="dev_understanding_global_variables__network_var_descr"><!-- --></a>A global merge field type to use when
                referencing Experience Cloud site details in a Visualforce email
                template.</span>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Use:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <span id="dev_understanding_global_variables__network_var_use1"><a name="dev_understanding_global_variables__network_var_use1"><!-- --></a>Use this expression in a Visualforce
                email template to access the Experience Cloud site name and
                login URL.</span>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Visualforce Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x" id="dev_understanding_global_variables__network_var_example"><a name="dev_understanding_global_variables__network_var_example"><!-- --></a><code class="language-markup">&lt;messaging:emailTemplate subject="Your Password has been reset" recipientType="User"&gt;
    &lt;messaging:htmlEmailBody &gt;
        &lt;p&gt;Hi,&lt;/p&gt;
        &lt;p&gt;Your password for &lt;b&gt;{!$Network.Name}&lt;/b&gt; has been reset.&lt;/p&gt;
        &lt;p&gt;&lt;a href='https://help.salesforce.com/s/%7B!$Network.NetworkUrlForUserEmails%7D'&gt;Reset Password&lt;/a&gt;&lt;/p&gt;
        &lt;p&gt;Regards,&lt;/p&gt;
        &lt;p&gt;Community Manager&lt;/p&gt;
    &lt;/messaging:htmlEmailBody&gt;
&lt;/messaging:emailTemplate&gt;</code></pre>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Tips:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">This global variable works only in Visualforce email templates
              for Experience Cloud sites.</td>

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

## $MessageChannel

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:19.011406844106464%">
          <col style="width:80.98859315589354%">
        </colgroup>
        <tbody>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Description:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <span id="dev_understanding_global_variables__message_channel_descr"><a name="dev_understanding_global_variables__message_channel_descr"><!-- --></a>A global merge field type to
                provide access to a message channel defined in your
                organization.</span>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Use:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <span id="dev_understanding_global_variables__message_channel_use"><a name="dev_understanding_global_variables__message_channel_use"><!-- --></a>Use this expression in your
                Visualforce page to access a message channel and use the
                Lightning Message Service APIs.</span>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Visualforce Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x" id="dev_understanding_global_variables__message_channel_example"><a name="dev_understanding_global_variables__message_channel_example"><!-- --></a><code class="language-markup">&lt;apex:page&gt;
    &lt;script&gt;
        // Load the MessageChannel token in a variable
        var SAMPLEMC = "{!$MessageChannel.SampleMessageChannel__c}";
        function handleClick() {
            const payload = {
                recordId: "some string",
                recordData: {value: "some value"}
            }
            sforce.one.publish(SAMPLEMC, payload);
        }
    &lt;/script&gt;
    &lt;div&gt;
        &lt;p&gt;Publish SampleMessageChannel&lt;/p&gt;
        &lt;button onclick="handleClick()"&gt;Publish&lt;/button&gt;
    &lt;/div&gt;
&lt;/apex:page&gt;</code></pre>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Tips:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">This global variable is available for Visualforce pages.</td>

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

## $ObjectType

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:19.011406844106464%">
          <col style="width:80.98859315589354%">
        </colgroup>
        <tbody>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Description:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <span id="dev_understanding_global_variables__objecttype_var_descr"><a name="dev_understanding_global_variables__objecttype_var_descr"><!-- --></a>A global merge field type to use
                when referencing standard or custom objects (such as Accounts,
                Cases, or Opportunities) and the values of their fields.</span>
              <span id="dev_understanding_global_variables__objecttype_var_descr_purpose"><a name="dev_understanding_global_variables__objecttype_var_descr_purpose"><!-- --></a>Use object type merge fields
                in <code>LINKTO</code>, <code>GETRECORDIDS</code>, and <code>URLFOR</code> functions to reference a
                specific type of data or the <code>VLOOKUP</code> function to reference a specific field in
                a related object.</span>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Use:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <ul>
                <li>Select the field type: $ObjectType. </li>

                <li>Select an object to insert a merge field representing that
                  object, such as
                  <samp class="parmname">$ObjectType.Case</samp>.<p>Optionally,
                    select a field on that object using this syntax:
                    <samp class="parmname">$ObjectType.Role_Limit__c.Fields.Limit__c</samp>.
                  </p>
                </li>

              </ul>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Custom Button Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <p>This custom list button references the cases standard object in
                the <samp class="parmname">$ObjectType.Case</samp> merge
                field.</p>
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-javascript">{!REQUIRESCRIPT ("/soap/ajax/13.0/connection.js")}
var records = {!GETRECORDIDS($ObjectType.Sample)};
var newRecords = [];
if (records[0] == null) {
    alert("Please select at least one row")
} else {
    for (var n=0; n&lt;records.length; n++) {
        var c = new sforce.SObject("Case");
        c.id = records[n];
        c.Status = "New";
        newRecords.push(c);
    }
    result = sforce.connection.update(newRecords);
    window.location.reload();
}</code></pre>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Validation Rule Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <p>This example checks that a billing postal code is valid by
                looking up the first five characters of the value in a custom object
                called Zip_Code__c that contains a record for every valid zip code
                in the US. If the zip code isn’t found in the Zip_Code__c object or
                the billing state doesn’t match the corresponding State_Code__c in
                the Zip_Code__c object, an error is
                displayed.</p>
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>AND(
    LEN(BillingPostalCode) &gt; 0, 
    OR(BillingCountry = "USA", BillingCountry = "US"), 
    VLOOKUP(
        $ObjectType.Zip_Code__c.Fields.State_Code__c,
        $ObjectType.Zip_Code__c.Fields.Name,
        LEFT(BillingPostalCode,5)
    ) &lt;&gt; BillingState
)</code></pre>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Visualforce Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <div id="dev_understanding_global_variables__objecttype_var_vf_example"><a name="dev_understanding_global_variables__objecttype_var_vf_example"><!-- --></a>
                <p>This example retrieves the label
                  for the Account <code>Name</code>
                  field:</p>
                <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-markup">{!$ObjectType.Account.Fields.Name.Label}</code></pre>
              </div>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Tips:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">This global variable is available in Visualforce pages, custom
              buttons and links, s-controls, and validation rules.</td>

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

## $Organization

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:19.011406844106464%">
          <col style="width:80.98859315589354%">
        </colgroup>
        <tbody>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Description: </td>

            <td class="slds-cell-wrap" style="vertical-align:top;">A global merge field type to use when referencing information
              about your company profile. Use organization merge fields to
              reference your organization’s city, fax, ID, or other
              details.</td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Use: </td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <ul>
                <li>Select the field type: $Organization. </li>

                <li>Select a merge field such as
                  <samp class="parmname">$Organization.Fax</samp>.
                </li>

              </ul>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Validation Rule Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <p>Use organization merge fields to compare any attribute for your
                organization with that of your accounts. For example, you may want
                to determine if your organization has the same country as your
                accounts. This validation formula references your
                organization’s country merge field and requires a country
                code for any account that’s
                foreign.</p>
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>AND($Organization.Country &lt;&gt; BillingCountry, ISBLANK(Country_Code__c))</code></pre>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Flow Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">Create a flow formula (Text) whose expression is <code>{!$Organization.City}</code>. In a
              Decision element, check whether a contact’s city matches that
              formula.</td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Visualforce Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <div>
                <p>Use dot notation to access your organization’s
                  information. For
                  example:</p>
                <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-markup">{!$Organization.Street}
{!$Organization.State}</code></pre>
              </div>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Tips:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <p>The organization merge fields get their values from whatever
                values are currently stored as part of your company information
                in Salesforce.</p>
              <p style="margin-bottom:0;">Note that <code>{!$Organization.UiSkin}</code> is a picklist value, so
                use it with picklist functions such as <code>ISPICKVAL()</code> in custom fields,
                validation rules, Visualforce expressions, flow formulas,
                process formulas, and workflow rule formulas.</p>
            </td>

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

## $Page

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:19.011406844106464%">
          <col style="width:80.98859315589354%">
        </colgroup>
        <tbody>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Description: </td>

            <td class="slds-cell-wrap" style="vertical-align:top;">A global merge field type to use when referencing a Visualforce
              page.</td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Use:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">Use this expression in a Visualforce page to link to another
              Visualforce page.</td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Visualforce Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x" id="dev_understanding_global_variables__page_var_vf_example"><a name="dev_understanding_global_variables__page_var_vf_example"><!-- --></a><code class="language-markup">&lt;apex:page&gt;
    &lt;h1&gt;Linked&lt;/h1&gt;
    &lt;apex:outputLink value="{!$Page.otherPage}"&gt;
        This is a link to another page.
    &lt;/apex:outputLink&gt;
&lt;/apex:page&gt;</code></pre>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Tips:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">This global variable is only available for Visualforce
              pages.</td>

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

## $Permission

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:19.011406844106464%">
          <col style="width:80.98859315589354%">
        </colgroup>
        <tbody>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Description:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">A global merge field type to use when referencing information
              about the current user’s custom permission access. Use permission
              merge fields to reference information about the user’s current
              access to any of your organization’s custom permissions.</td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Use:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <ul>
                <li>Select the field type: $Permission. </li>

                <li>Select a merge field such as
                  <samp class="parmname">$Permission.customPermissionName</samp>.
                </li>

              </ul>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Validation Rule Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <p>This validation rule references the custom permission
                changeAustinAccounts for the current user. This rule ensures that
                only users with changeAustinAccounts can update accounts with a
                billing city of
                Austin.</p>
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-markup">BillingCity = 'Austin' &amp;&amp; $Permission.changeAustinAccounts</code></pre>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Flow Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <p>This flow formula evaluates whether the current user has the
                deleteCandidates custom
                permission.</p>
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>{!$Permission.deleteCandidates}</code></pre>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Visualforce Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <p>To have a pageblock appear only for users that have the custom
                permission seeExecutiveData, use
                this:</p>
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x" id="dev_understanding_global_variables__permission_vf_example_code"><a name="dev_understanding_global_variables__permission_vf_example_code"><!-- --></a><code class="language-markup">&lt;apex:pageBlock rendered="{!$Permission.canSeeExecutiveData}"&gt;
    &lt;!-- Executive Data Here --&gt;
&lt;/apex:pageBlock&gt;</code></pre>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Tips:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">$Permission appears only when custom permissions have been
              created in your organization. This global variable isn’t supported
              for processes, flows, and workflow rules.</td>

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

## $Profile

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:19.011406844106464%">
          <col style="width:80.98859315589354%">
        </colgroup>
        <tbody>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Description:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">A global merge field type to use when referencing information
              about the current user’s profile. Use profile merge fields to
              reference information about the user’s profile such as
              license type or name.</td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Use:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <ul>
                <li>Select the field type: $Profile. </li>

                <li>Select a merge field such as
                  <samp class="parmname">$Profile.Name</samp>.
                </li>

              </ul>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Validation Rule Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <p>This validation rule formula references the profile name of the
                current user to ensure that only the record owner or users with this
                profile can make changes to a custom field called Personal
                Goal:</p>
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>AND(
    ISCHANGED( Personal_Goal__c ), 
    Owner &lt;&gt; $User.Id, 
    $Profile.Name &lt;&gt; "Custom: System Admin" 
)</code></pre>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Flow Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <p>Create a flow formula (Text) with this
                expression.</p>
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>{!$Profile.Name}</code></pre>
              <p style="margin-bottom:0;">By
                referencing that formula, you avoid using a query (Lookup elements)
                and save on limits.</p>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Visualforce Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <p>To return the current user's profile, use
                this:</p>
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>{!$Profile.Name}</code></pre>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Tips:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <ul>
                <li><samp class="parmname">$Profile</samp> merge fields are only
                  available in editions that can create custom profiles.</li>

                <li>
                  <p>Use profile names to reference standard profiles in
                    <samp class="parmname">$Profile</samp> merge fields.
                  </p>
                </li>

                <li>Your merge field values are blank when the profile
                  attributes are blank. For example, profile
                  <samp class="parmname">Description</samp> isn’t required and
                  sometimes doesn’t contain a value.
                </li>

                <li>You don’t need to give users permissions or access
                  rights to their profile information to use these merge
                  fields.</li>

              </ul>
            </td>

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

If you previously referenced the internal value for a profile, use this list to determine the name to use instead:

 
| Standard Profile Name | $Profile Value |
| --- | --- |
| System Administrator | `PT1` |
| Standard User | `PT2` |
| Ready Only | `PT3` |
| Solution Manager | `PT4` |
| Marketing User | `PT5` |
| Contract Manager | `PT6` |
| Partner User | `PT7` |
| Standard Platform User | `PT8` |
| Standard Platform One App User | `PT9` |
| Customer Portal User | `PT13` |
| Customer Portal Manager | `PT14` |

## $RecordType

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:19.493177387914233%">
          <col style="width:80.50682261208577%">
        </colgroup>
        <tbody>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Description: </td>

            <td class="slds-cell-wrap" style="vertical-align:top;">A global merge field to use when referencing the record type of
              the current record.</td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">
              <strong>Use:</strong>
            </td>

            <td class="slds-cell-wrap" style="vertical-align:top;">Add <samp class="parmname">$RecordType</samp> manually to your
              s-control.</td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Visualforce Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <p>To return the ID of the current record type, use
                this:</p>
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>{$RecordType.Id}</code></pre>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Tips:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <ul>
                <li>Use <samp class="parmname">$RecordType.Id</samp> instead of
                  <samp class="parmname">$RecordType.Name</samp> to reference a
                  specific record type. While
                  <samp class="parmname">$RecordType.Name</samp> makes a formula
                  more readable, you must update the formula if the name of
                  the record type changes, whereas the ID of a record type
                  never changes. However, when you are deploying formulas
                  across organizations (for example, between sandbox and
                  production), use <samp class="parmname">$RecordType.Name</samp>
                  because IDs aren’t the same across organizations.
                </li>

                <li>Avoid using <samp class="parmname">$RecordType</samp> in formulas,
                  except in default value formulas. Instead, use the
                  <samp class="parmname">RecordType</samp> merge field (for
                  example, <samp class="parmname">Account.RecordType.Name</samp>) or
                  the <samp class="parmname">RecordTypeId</samp> field on the object.
                </li>

                <li>Don’t reference any field with the&nbsp;<code>$RecordType</code> merge field in
                  cross-object formulas. The <code>$RecordType</code>&nbsp;variable resolves to the
                  record containing the formula, not the record to which the
                  formula spans. Use the&nbsp;<code>RecordType</code> merge field on the object
                  instead.</li>

              </ul>
            </td>

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

## $Request

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:19.493177387914233%">
          <col style="width:80.50682261208577%">
        </colgroup>
        <tbody>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Description: </td>

            <td class="slds-cell-wrap" style="vertical-align:top;">A global merge field to use when referencing a query parameter by
              name that returns a value.</td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Use: </td>

            <td class="slds-cell-wrap" style="vertical-align:top;">Add <samp class="parmname">$Request</samp> manually to your
              s-control.</td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">S-Control Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <p>This snippet, named <code>Title_Snippet</code>, requires two input parameters: <code>titleTheme</code> and <code>titleText</code>. You can reuse it in
                many s-controls to provide page title and theme in your HTML.
              </p>
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-html">&lt;h2 class="{!$Request.titleTheme}.title"&gt;
    {!$Request.titleText}
&lt;/h2&gt;</code></pre>
              <p>This s-control calls this snippet using
                the <code>INCLUDE</code> function,
                sending it the parameters for both the title and theme of the
                HTML page it
                creates.</p>
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-html">&lt;html&gt;
    &lt;head/&gt;
    &lt;body&gt; 
        {!INCLUDE(
                $SControl.Title_Snippet, 
                [titleTheme = "modern", titleText = "My Sample Title"]
        )}
        Insert your page-specific content here ... 
    &lt;/body&gt; 
&lt;/html&gt;</code></pre>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Tips:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">Don’t use <samp class="parmname">$Request</samp> in Visualforce
              pages to reference query parameters. Use
              <samp class="parmname">$CurrentPage</samp> instead.
            </td>

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

## $Resource

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:19.493177387914233%">
          <col style="width:80.50682261208577%">
        </colgroup>
        <tbody>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Description: </td>

            <td class="slds-cell-wrap" style="vertical-align:top;">A global merge field type to use when referencing an existing
              static resource by name in a Visualforce page. You can also use
              resource merge fields in <code>URLFOR</code>
              functions to reference a particular file in a static resource
              archive.</td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Use: </td>

            <td class="slds-cell-wrap" style="vertical-align:top;">Use <samp class="parmname">$Resource</samp> to reference an existing
              static resource. The format is
              <samp class="parmname">$Resource.nameOfResource</samp>, such as
              <samp class="parmname">$Resource.TestImage</samp>.
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Visualforce Examples:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <div id="dev_understanding_global_variables__resource_var_vf_example"><a name="dev_understanding_global_variables__resource_var_vf_example"><!-- --></a>
                <p>This Visualforce component
                  references an image file that was uploaded as a static resource
                  and given the name <samp class="parmname">TestImage</samp>:
                </p>
                <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-markup">&lt;apex:image url="{!$Resource.TestImage}" width="50" height="50"/&gt;</code></pre>
                <p>To
                  reference a file in an archive (such as a
                  <samp class="filepath">.zip</samp> or <samp class="filepath">.jar</samp>
                  file), use the <code>URLFOR</code>
                  function. Specify the static resource name that you provided
                  when you uploaded the archive with the first parameter and the
                  path to the desired file within the archive with the second. For
                  example:
                </p>
                <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-markup">&lt;apex:image url="{!URLFOR($Resource.TestZip, 'images/Bluehills.jpg')}" 
    width="50" height="50"/&gt;</code></pre>
              </div>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Tips:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">This global variable is only available for Visualforce
              pages.</td>

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

## $SControl

![Important](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_code-264-0-0-production-enus/789bc523-706b-4ae4-8fe9-be6322e38b6b/images/icon_important.png)

Important Visualforce pages supersede s-controls. Organizations that haven't previously used s-controls can’t create them. Existing s-controls are unaffected and can still be edited.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:19.493177387914233%">
          <col style="width:80.50682261208577%">
        </colgroup>
        <tbody>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Description: </td>

            <td class="slds-cell-wrap" style="vertical-align:top;"><span id="dev_understanding_global_variables__scontrol_var_descr"><a name="dev_understanding_global_variables__scontrol_var_descr"><!-- --></a>A global merge field type to use when
                referencing an existing custom s-control by name.</span> Use
              s-control merge fields in <code>LINKTO</code>, <code>INCLUDE</code>,
              and <code>URLFOR</code> functions to
              reference one of your custom s-controls.</td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Use:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <ul>
                <li>Select the field type: $SControl.</li>

                <li>Select an s-control to insert a merge field representing
                  that s-control, such as
                  <samp class="parmname">$Scontrol.Header_Snippet</samp>.
                </li>

              </ul>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">S-Control Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <p>This s-control references the snippet in the
                <samp class="parmname">$Scontrol.Header_Snippet</samp> merge
                field:
              </p>
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-html">&lt;html&gt;
    &lt;body&gt;
        {!INCLUDE(
            $SControl.Header_Snippet, 
            [title = "My Title", theme = "modern"]
         )}
    &lt;/body&gt;
&lt;/html&gt;</code></pre>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Visualforce Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <p>This example shows how to link to an s-control named HelloWorld
                in a Visualforce
                page:</p>
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-markup">&lt;apex:page&gt;
    &lt;apex:outputLink value="{!$SControl.HelloWorld}"&gt;
        Open the HelloWorld s-control
    &lt;/apex:outputLink&gt;
&lt;/apex:page&gt;</code></pre>
              <p>Note that if you want to embed an
                s-control in a page, you can use the <code>&lt;apex:scontrol&gt;</code> tag
                without the $SControl merge field. For
                example:</p>
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-markup">&lt;apex:page&gt;
    &lt;apex:scontrol controlName="HelloWorld" /&gt;
&lt;/apex:page&gt;</code></pre>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Tips:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <ul>
                <li>The drop-down list for <samp class="parmname">Insert Merge
                    Field</samp> lists all your custom s-controls except
                  snippets. Although snippets are s-controls, they behave
                  differently. For example, you can’t reference a
                  snippet from a <code>URLFOR</code>
                  function directly; snippets aren’t available when creating a
                  custom button or link that has a <samp class="parmname">Content
                    Source</samp> of Custom S-Control; and you
                  can’t add snippets to your page layouts. To insert a
                  snippet in your s-control, use the <strong class="uicontrol">Insert
                    Snippet</strong> drop-down button.</li>

                <li>This global variable is only available for custom buttons
                  and links, s-controls, and Visualforce pages.</li>

              </ul>
            </td>

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

## $Setup

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:19.493177387914233%">
          <col style="width:80.50682261208577%">
        </colgroup>
        <tbody>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Description:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">A global merge field type to use when referencing a custom
              setting of type “hierarchy.”</td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Use:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <p>Use <code>$Setup</code> to access
                hierarchical custom settings and their field values using dot
                notation. For example, <code>$Setup.App_Prefs__c.Show_Help_Content__c</code>. </p>
              <p>Hierarchical custom settings allow values at any of three
                different levels:</p>
              <ul>
                <li>Organization, the default value for everyone</li>

                <li>Profile, which overrides the Organization value</li>

                <li>User, which overrides both Organization and Profile
                  values</li>

              </ul>
              <p style="margin-bottom:0;">Salesforce automatically determines the correct value for this
                custom setting field based on the running user’s current
                context.</p>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Formula Field Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>{!$Setup.<var>CustomSettingName</var>__c.<var>CustomFieldName</var>__c}</code></pre>
              <p style="margin-bottom:0;">Formula
                fields only work for hierarchy custom settings; they can’t be
                used for list custom settings.</p>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Visualforce Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <div>
                <p>This example illustrates how to conditionally display an extended
                  help message for an input field, depending on the user’s
                  preference:</p>
                <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-markup">&lt;apex:page&gt;
    &lt;apex:inputField value="{!usr.Workstation_Height__c}"/&gt;
    &lt;apex:outputPanel id="helpWorkstationHeight" 
        rendered="{!$Setup.App_Prefs__c.Show_Help_Content__c}"&gt;
        Enter the height for your workstation in inches, measured from the 
        floor to top of the work surface.
    &lt;/apex:outputPanel&gt;
    ...
&lt;/apex:page&gt;
</code></pre>
                <p>If the organization level for the custom setting is
                  set to <code>true</code>, users see the
                  extended help message by default. If an individual prefers to
                  not see the help messages, they can set their custom setting to
                  <code>false</code> to override the
                  organization (or profile) value.
                </p>
              </div>
              <p style="margin-bottom:0;" id="dev_understanding_global_variables__global_variable_setup_visualforce_note"><a name="dev_understanding_global_variables__global_variable_setup_visualforce_note"><!-- --></a>Custom settings of
                type “list” aren’t available on Visualforce
                pages using this global variable. You can access list custom
                settings in Apex.</p>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Tips:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">This global variable is available in Visualforce pages, formula
              fields, validation rules, flows, and process formulas.</td>

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

## $Site

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:19.493177387914233%">
          <col style="width:80.50682261208577%">
        </colgroup>
        <tbody>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Description: </td>

            <td class="slds-cell-wrap" style="vertical-align:top;">A global merge field type to use when referencing information
              about the current Salesforce site.</td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Use: </td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <p style="margin-bottom:0;" id="dev_understanding_global_variables__SiteUse"><a name="dev_understanding_global_variables__SiteUse"><!-- --></a>Use dot notation to access information about the
                current Salesforce site. </p>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Visualforce Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <p>This example shows how to use the <code>$Site.Template</code> merge
                field:</p>
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x" id="dev_understanding_global_variables__SiteExample"><a name="dev_understanding_global_variables__SiteExample"><!-- --></a><code class="language-markup">&lt;apex:page title="Job Application Confirmation" showHeader="false" 
    standardStylesheets="true"&gt;

    &lt;!-- The site template provides layout &amp; style for the site --&gt;
    &lt;apex:composition template="{!$Site.Template}"&gt;

    &lt;apex:define name="body"&gt;
        &lt;apex:form&gt;
            &lt;apex:commandLink value="&lt;- Back to Job Search" 
                onclick="window.top.location='{!$Page.PublicJobs}';return false;"/&gt;
            &lt;br/&gt;
            &lt;br/&gt;
            &lt;center&gt;
                &lt;apex:outputText value="Your application has been saved. 
                    Thank you for your interest!"/&gt;
            &lt;/center&gt;
            &lt;br/&gt;
            &lt;br/&gt;
        &lt;/apex:form&gt;
    &lt;/apex:define&gt;
    
    &lt;/apex:composition&gt;
&lt;/apex:page&gt;</code></pre>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Tips:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">This global variable is available in Visualforce pages, email
              templates, and s-controls.</td>

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

Note that only these site fields are available:

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:37.5%">
          <col style="width:62.5%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d16337e2852">Merge Field</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d16337e2855">Description</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2852 ">$Site.Name</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2855 ">Returns the API name of the current site.</td>

          </tr>
          <tr class="">
            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2852 ">$Site.Domain</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2855 ">Returns your Salesforce Sites based URL.</td>

          </tr>
          <tr class="">
            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2852 ">$Site.CustomWebAddress</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2855 ">Returns the request's custom URL if it doesn't end in
              <samp class="filepath">force.com</samp> or returns the site's primary
              custom URL. If neither exist, then this returns an empty string.
              Note that the URL's path is always the root, even if the request's
              custom URL has a path prefix. If the current request isn't a site
              request, then this field returns an empty string. This field's value
              always ends with a <code>/</code> character.
              Use of $Site.CustomWebAddress is discouraged, and we recommend using
              $Site.BaseCustomUrl instead.
            </td>

          </tr>
          <tr class="">
            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2852 ">$Site.OriginalUrl</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2855 ">Returns the original URL for this page if it’s a
              designated error page for the site; otherwise, returns <code>null</code>.</td>

          </tr>
          <tr class="">
            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2852 ">$Site.CurrentSiteUrl</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2855 ">Returns the base URL of the current site that references and
              links should use. Note that this field might return the referring
              page's URL instead of the current request's URL. This field's value
              includes a path prefix and always ends with a <code>/</code> character. If the current request
              isn't a site request, then this field returns an empty string. Use
              of $Site.CurrentSiteUrl is discouraged. Use $Site.BaseUrl
              instead.</td>

          </tr>
          <tr class="">
            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2852 ">$Site.LoginEnabled</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2855 ">Returns <code>true</code> if the current
              site is associated with an active login-enabled portal; otherwise
              returns <code>false</code>.</td>

          </tr>
          <tr class="">
            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2852 ">$Site.RegistrationEnabled</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2855 ">Returns <code>true</code> if the current
              site is associated with an active self-registration-enabled Customer
              Portal; otherwise returns <code>false</code>.</td>

          </tr>
          <tr class="">
            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2852 ">$Site.IsPasswordExpired</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2855 ">For authenticated users, returns <code>true</code> if the currently logged-in user's password is
              expired. For non-authenticated users, returns <code>false</code>.</td>

          </tr>
          <tr class="">
            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2852 ">$Site.AdminEmailAddress</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2855 ">Returns an empty string. This merge field is deprecated.</td>

          </tr>
          <tr class="">
            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2852 ">$Site.Prefix</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2855 ">Returns the URL path prefix of the current site. For example, if
              your site URL is
              <samp class="filepath"><var>MyDomainName</var>.my.salesforce-sites.com/partners</samp>,
              <samp class="filepath">/partners</samp> is the path prefix. Returns
              <code>null</code> if the prefix
              isn’t defined. If the current request isn't a site request,
              then this field returns an empty string.
            </td>

          </tr>
          <tr class="">
            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2852 ">$Site.Template</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2855 ">Returns the template name associated with the current site;
              returns the default template if no template has been
              designated.</td>

          </tr>
          <tr class="">
            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2852 ">$Site.ErrorMessage</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2855 ">Returns an error message for the current page if it’s a
              designated error page for the site and an error exists; otherwise,
              returns an empty string.</td>

          </tr>
          <tr class="">
            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2852 ">$Site.ErrorDescription</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2855 ">Returns the error description for the current page if it’s
              a designated error page for the site and an error exists; otherwise,
              returns an empty string.</td>

          </tr>
          <tr class="">
            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2852 ">$Site.AnalyticsTrackingCode</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2855 ">The tracking code associated with your site. Services such as
              Google Analytics can use this code to track page request data for
              your site.</td>

          </tr>
          <tr class="">
            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2852 ">$Site.BaseCustomUrl</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2855 ">
              <p>Returns a base URL for the current site that doesn’t use a
                subdomain. The returned URL uses the same protocol (HTTP or HTTPS)
                as the current request if at least one non-force.com custom URL that
                supports HTTPS exists on the site. The returned value never ends
                with a <code>/</code> character. If all the
                custom URLs in this site end in
                <samp class="filepath">force.com</samp> or
                <samp class="filepath">salesforce-sites.com</samp>, or if this site has
                no custom URL’s, then this returns an empty string. If the
                current request isn't a site request, then this method returns an
                empty string.
              </p>
              <p style="margin-bottom:0;">This field replaces
                <samp class="parmname">CustomWebAddress</samp> and includes the
                custom URL's path prefix.
              </p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2852 ">$Site.BaseInsecureUrl</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2855 ">This merge field is deprecated. Returns a base URL for the
              current site that uses HTTP instead of HTTPS. The current request's
              domain is used. The returned value includes the path prefix and
              never ends with a <code>/</code> character.
              If the current request isn't a site request, then this method
              returns an empty string</td>

          </tr>
          <tr class="">
            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2852 ">$Site.BaseRequestUrl</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2855 ">Returns the base URL of the current site for the requested URL.
              This isn't influenced by the referring page's URL. The returned URL
              uses the same protocol (HTTP or HTTPS) as the current request. The
              returned value includes the path prefix and never ends with a
              <code>/</code> character. If the current
              request isn't a site request, then this method returns an empty
              string.
            </td>

          </tr>
          <tr class="">
            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2852 ">$Site.BaseSecureUrl</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2855 ">Returns a base URL for the current site that uses HTTPS instead
              of HTTP. The current request's domain is preferred if it supports
              HTTPS. Domains that aren’t force.com subdomains are preferred over
              force.com subdomains. A force.com subdomain, if associated with the
              site, is used when no other HTTPS domains exist in the current site.
              If there are no HTTPS custom URLs in the site, then this method
              returns an empty string. The returned value includes the path prefix
              and never ends with a <code>/</code>
              character. If the current request isn't a site request, then this
              method returns an empty string.</td>

          </tr>
          <tr class="">
            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2852 ">$Site.BaseUrl</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2855 ">
              <p>Returns the base URL of the current site that references and
                links should use. Note that this field may return the referring
                page's URL instead of the current request's URL. This field's value
                includes the path prefix and never ends with a <code>/</code> character. If the current request
                isn't a site request, then this field returns an empty
                string.</p>
              <p style="margin-bottom:0;">This field replaces $Site.CurrentSiteUrl.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2852 ">$Site.MasterLabel</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2855 ">Returns the value of the Master Label field for the current site.
              If the current request isn't a site request, then this field returns
              an empty string.</td>

          </tr>
          <tr class="">
            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2852 ">$Site.SiteId</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2855 ">Returns the ID of the current site. If the current request isn't
              a site request, then this field returns an empty string.</td>

          </tr>
          <tr class="">
            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2852 ">$Site.SiteType</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2855 ">Returns the API value of the Site Type field for the current
              site. If the current request isn't a site request, then this field
              returns an empty string.</td>

          </tr>
          <tr class="">
            <td data-label="Merge Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2852 ">$Site.SiteTypeLabel</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d16337e2855 ">Returns the value of the Site Type field's label for the current
              site. If the current request isn't a site request, then this field
              returns an empty string.</td>

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

## $System.OriginDateTime

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:19.493177387914233%">
          <col style="width:80.50682261208577%">
        </colgroup>
        <tbody>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Description: </td>

            <td class="slds-cell-wrap" style="vertical-align:top;">A global merge field that represents the literal value of
              1900-01-01 00:00:00. Use this global variable when performing
              date/time offset calculations, or to assign a literal value to a
              date/time field.</td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Use: </td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <ul>
                <li>Select the field type: $System. </li>

                <li>Select <samp class="parmname">OriginDateTime</samp> from the
                  <samp class="parmname">Insert Merge Field</samp> option.
                </li>

              </ul>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Formula Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <p>This example illustrates how to convert a date field into a
                date/time field. It uses the date in the
                <samp class="parmname">OriginDateTime</samp> merge field to get the
                number of days since a custom field called <samp class="parmname">My Date
                  Field</samp>. Then, it adds the number of days to the
                <samp class="parmname">OriginDateTime</samp> value.
              </p>
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>$System.OriginDatetime + ( My_Date_Field__c - DATEVALUE($System.OriginDatetime) )</code></pre>
              <p style="margin-bottom:0;"><samp class="parmname">OriginDateTime</samp>
                is in the GMT time zone but the result is displayed in the
                user’s local time zone.</p>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Flow, Process, and Visualforce Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <div>
                <p>This example calculates the number of days that have passed
                  since January 1,
                  1900:</p>
                <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>{!NOW() - $System.OriginDateTime}</code></pre>
              </div>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Tips:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <p>This global variable is available in: </p>
              <ul>
                <li>Default values</li>
                <li>Flows</li>
                <li>Formulas in custom fields, processes, and workflow
                  rules</li>
                <li>Workflow field update actions</li>
                <li>Visualforce pages and s-controls</li>
              </ul>
            </td>

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

## $User

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:19.493177387914233%">
          <col style="width:80.50682261208577%">
        </colgroup>
        <tbody>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Description: </td>

            <td class="slds-cell-wrap" style="vertical-align:top;">A global merge field type to use when referencing information
              about the current user. User merge fields can reference information
              about the user such as alias, title, and ID. Most of the fields
              available on the <a href="https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_user.htm" target="_blank">User standard object</a> are also
              available on $User.</td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Use:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <ul>
                <li>Select the field type: $User. </li>

                <li>Select a merge field such as
                  <samp class="parmname">$User.Username</samp>.
                </li>

              </ul>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Validation Rule Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <p>This validation rule formula references the ID of the current
                user to determine if the current user is the owner of the record.
                Use an example like this to ensure that only the record owner or
                users with an administrator profile can make changes to a custom
                field called <samp class="parmname">Personal
                  Goal</samp>:</p>
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>AND(
    ISCHANGED( Personal_Goal__c ), 
    Owner &lt;&gt; $User.Id, 
    $Profile.Name &lt;&gt; "Custom: System Admin" 
)</code></pre>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Flow Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <p>Create a flow formula (Text) that has this
                expression.</p>
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>{!$User.FirstName} &amp; “ “ &amp; {!$User.LastName}</code></pre>
              <p style="margin-bottom:0;">Once
                you create that formula, reference it anywhere that you need to call
                the user by name in your flow. By referencing the $User global
                variable, you avoid using a Get Records element, which counts
                against flow limits.</p>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Visualforce Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <div>
                <p>This example displays the current user’s company name, as
                  well as the status of the current user (which returns a Boolean
                  value). </p>
                <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-markup">&lt;apex:page&gt;
    &lt;h1&gt;Congratulations&lt;/h1&gt;
    &lt;p&gt;This is your new Apex Page&lt;/p&gt;
    &lt;p&gt;
        The current company name for this user is: {!$User.CompanyName}
    &lt;/p&gt;
    &lt;p&gt;
        Is the user active?
        {!$User.isActive}
    &lt;/p&gt;
&lt;/apex:page&gt;</code></pre>
              </div>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Tips:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <ul>
                <li>The current user is the person changing the record that
                  prompted the default value, validation rule, or other
                  operation that uses these global merge fields.</li>

                <li>When a Web-to-Case or Web-to-Lead process changed a record,
                  the current user is the <samp class="parmname">Default Lead
                    Owner</samp> or <samp class="parmname">Default Case
                    Owner</samp>.</li>

                <li>When a process executes scheduled actions and the user who
                  started the process is no longer active, $User refers to the
                  default workflow user. The same goes for time-based actions
                  in workflow rules.</li>

                <li>Some of the $User merge fields can be used in mobile
                  configuration filters.
                </li>

              </ul>
            </td>

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

## $User.UITheme and $User.UIThemeDisplayed

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:19.493177387914233%">
          <col style="width:80.50682261208577%">
        </colgroup>
        <tbody>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Description:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <p>These global merge fields identify the Salesforce look and feel a
                user sees on a given Web page.</p>
              <p>The difference between the two
                variables is that <samp class="parmname">$User.UITheme</samp> returns the
                look and feel the user is supposed to see, while
                <samp class="parmname">$User.UIThemeDisplayed</samp> 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, <samp class="parmname">$User.UIThemeDisplayed</samp>
                returns a different value.
              </p>
              <p style="margin-bottom:0;">Running Classic and Lightning
                Experience in different browser tabs or windows isn't supported
                and can cause unexpected behavior in the look and feel of your
                org and the values returned by the
                <samp class="parmname">$User.UITheme</samp> and
                <samp class="parmname">$User.UIThemeDisplayed</samp> fields. For
                example, if your org is using Lightning Experience, but you
                switch to Classic in a different browser tab, these fields
                return a Classic theme in both tabs.
              </p>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">
              <strong>Use:</strong>
            </td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <p>Use these variables to identify the CSS used to render Salesforce
                web pages to a user. Both variables return one of these 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 class="slds-cell-wrap" style="vertical-align:top;">Visualforce Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <p>This shows how you can render different layouts based on a
                user’s
                theme:</p>
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x" id="dev_understanding_global_variables__UIThemeEx2"><a name="dev_understanding_global_variables__UIThemeEx2"><!-- --></a><code class="language-markup">&lt;apex:page&gt;
    &lt;apex:pageBlock title="My Content" rendered="{!$User.UITheme == 'Theme2'}"&gt;
        // this is the old theme...
    &lt;/apex:pageBlock&gt;

    &lt;apex:pageBlock title="My Content" rendered="{!$User.UITheme == 'Theme3'}"&gt;
       // this is the classic theme ...
    &lt;/apex:pageBlock&gt;
&lt;/apex:page&gt;</code></pre>
            </td>

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

## $UserRole

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:19.493177387914233%">
          <col style="width:80.50682261208577%">
        </colgroup>
        <tbody>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Description:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">A global merge field type to use when referencing information
              about the current user’s role. Role merge fields can
              reference information such as role name, description, and
              ID.</td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Use:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <ul>
                <li>Select the field type: $UserRole. </li>

                <li>Select a merge field, such as
                  <samp class="parmname">$UserRole.Name</samp>.
                </li>

              </ul>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Validation Rule Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <p>This validation rule formula references the user role name to
                validate that a custom field called <samp class="parmname">Discount
                  Percent</samp> doesn't exceed the maximum value allowed for
                that
                role:</p>
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>Discount_Percent__c &gt; VLOOKUP(
    $ObjectType.Role_Limits__c.Fields.Limit__c,
    $ObjectType.Role_Limits__c.Fields.Name, 
    $UserRole.Name
)</code></pre>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Process, Flow, and Visualforce Example:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>{!$UserRole.LastModifiedById}</code></pre>
            </td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Tips:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;">
              <ul>
                <li>The current user is the person changing the record that
                  prompted the default value, validation rule, or other
                  operation that uses these global merge fields.</li>

                <li>When a Web-to-Case or Web-to-Lead process changed a record,
                  the current user is the <samp class="parmname">Default Lead
                    Owner</samp> or <samp class="parmname">Default Case
                    Owner</samp>.</li>

                <li>When a process executes scheduled actions and the user who
                  started the process is no longer active, $UserRole refers to
                  role of the default workflow user. The same goes for
                  time-based actions in workflow rules.</li>

              </ul>
              <p>You can’t use these <code>$UserRole</code> values in Visualforce:</p>
              <ul>
                <li>
                  <code>CaseAccessForAccountOwner</code>
                </li>

                <li>
                  <code>ContactAccessForAccountOwner
                                        </code>
                </li>

                <li>
                  <code>OpportunityAccessForAccountOwner</code>
                </li>

                <li>
                  <code>PortalType</code>
                </li>

              </ul>
            </td>

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

#### See Also

- [Valid Values for the $Action Global Variable](https://help.salesforce.com/s/articleView?id=platform.dev_action_values.htm&release=264.0.0&type=5 "All objects support basic actions, such as new, clone, view, edit, list, and delete. The $Action global also references actions available on many standard objects. The values available in your organization may differ depending on the features you enable.")
- [Flow Resource: Global Variables](https://help.salesforce.com/s/articleView?id=platform.flow_ref_resources_global_variables.htm&type=5&language=en_US)