---
schema_version: "1"
id: 8eb58b77b3afbccedf2ae5a0a1b3037dae628b4588318a69d5d5be259f1f971e
title: Merge Fields for Validation Rules
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/fields_merge_fields_validation_rules.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.fields_merge_fields_validation_rules.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: cda92af3edcffe6471d69928447f27e4cd00779c5c6667b0dc87a924564653dc
description: A merge field is a field you can put in an email template, mail merge template, custom link, or formula to incorporate values from a record.
products:
  - Salesforce Platform
  - Security
release: "264"
---
# Merge Fields for Validation Rules

A merge field is a field you can put in an email template, mail merge template, custom link, or formula to incorporate values from a record.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: both Salesforce Classic and Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Essentials</strong>, <strong>Contact Manager</strong>, <strong>Group</strong>, <strong>Professional</strong>, <strong>Enterprise</strong>, <strong>Performance</strong>, <strong>Unlimited</strong>, <strong>Developer</strong>, and <strong>Database.com</strong> Editions</td></tr></tbody></table>

## Syntax and Formatting

When you insert a merge field in a validation rule, the syntax consists of the object, a period, and the field name. For example, $User.State corresponds with a user’s state or province.

A merge field’s syntax can vary depending on where you’re using the field. To make sure you’re using the correct syntax, select merge fields from the drop-down list in the editor where you’re using the merge field. The merge fields for validation rules correspond directly with the fields in your app.

For a list of fields in an object, from the management settings for the object, go to the fields section.

![Important](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_click-264-0-0-production-enus/5f7d9219-b7b1-4552-8891-f1aba9b289fc/images/icon_important.png)

Important

- If two or more custom objects have matching names or labels, only one of the objects appears when you select from available merge fields. Make sure that all custom objects have unique names and labels so that you can select merge fields from any of the objects.

## Limitations

Validation rules can’t reference merge fields for:

- Auto number fields, such as Requisition Number
- Compound fields, such as addresses, first and last names, dependent picklists, and dependent lookups
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_click-264-0-0-production-enus/5f7d9219-b7b1-4552-8891-f1aba9b289fc/images/icon_note.png)
    
    Note Validation rules can reference merge fields individual address fields, such as Billing City.
- Campaign statistic fields, including statistics for individual campaigns and campaign hierarchies

## Tips

- Some merge fields display as radio buttons but function like picklist fields when referenced in a formula.
    
    Use the values “Read,” “Edit,” and “None” in a formula when referencing:
    
    - $UserRole.CaseAccessForAccountOwner
    - $UserRole.OpportunityAccessForAccountOwner
    - CaseAccessLevel (on Territory)
    - OpportunityAccessLevel (on Territory)
    
    Use the values “Read,” “Edit,” and “All” in a formula when referencing:
    
    - AccountAccessLevel (on Territory)
- Use the RecordType.Id merge field in your formula to apply different validations for different record types.

#### See Also

- [Find Object Management Settings](https://help.salesforce.com/s/articleView?id=platform.extend_click_find_objectmgmt_parent.htm&release=264.0.0&type=5 "Salesforce lets you personalize your object model with features like custom fields, page layouts, and validation rules. Depending on which experience of Salesforce you have enabled, these customizations are located in different areas of Setup.")