---
schema_version: "1"
id: c65181be321d1c1016e73b9846889339a66aaecd628de5ce2da9f40475214650
title: Merge Field Syntax
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/merge_fields_syntax.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.merge_fields_syntax.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 4371ef84a66e9639f19ff3c9c024e5d317eda302f53f6b116695912646989581
description: A merge field’s syntax can vary depending on where you use the field. To make sure that you use the correct syntax, select merge fields from the dropdown list in the editor where you use the merge field.
products:
  - Salesforce Platform
  - Security
release: "264"
---
# Merge Field Syntax

A merge field’s syntax can vary depending on where you use the field. To make sure that you use the correct syntax, select merge fields from the dropdown list in the editor where you use the merge field.

### 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;">The available merge fields vary according to which Salesforce edition you have.</td></tr></tbody></table>

Custom objects and fields are always appended with `__c` when referenced. The object precedes field labels, and all spaces convert to underscores. For example, `Account.CreatedDate` references the Created Date standard field for the account object.

In standard relationships, the name of the relationship is the master object. For example, you can reference the account name from a contact validation rule using `Account.Name`. You can reference the phone number of the account creator from an opportunity product formula field using `Opportunity.Account.CreatedBy.Phone`. In custom relationships, the name of the relationship is the value specified in Field Name with `__r` appended to it. For example, you can reference contact email from a custom object validation rule using `Contact__r.Email`.