When creating a Mail Merge template in Salesforce Classic, you need the exact field names (also called merge field names) for the fields you want to include. Salesforce provides a URL that returns an XML file listing all available field names for any specific record.
This article explains how to use this URL to quickly look up field names without manually browsing the object's field list in Setup.
Note: Mail Merge in Salesforce uses Salesforce Classic and Microsoft Word. This method is applicable to Salesforce Classic only.
Step 1 — Construct the URL
Use the following URL format to retrieve the field names for any record:https://<org domain>.salesforce.com/servlet/servlet.SForceMailMerge?id=<RecordID>
<org domain> with your Salesforce org instance (for example: na1, na2, or mydomain.my if My Domain is enabled).<RecordID> with the 15- or 18-character Salesforce ID of the record you want to inspect.Step 2 — Open the URL in Your Browser
Paste the constructed URL into your browser's address bar and press Enter. The page returns an XML file that lists all available fields for that record, with each field name appearing in double quotes.
Example output:
<data fieldName="ACCOUNT_NAME">Company Name</data>
<data fieldName="ACCOUNT_TYPE"/>
<data fieldName="ACCOUNT_RECORDTYPE">Record Type Name</data>
<data fieldName="ACCOUNT_PARENT">ABC Labs</data>
In this example, to use the account name as a mail merge field, you would use ACCOUNT_NAME as the merge field in your Microsoft Word template, which renders as «ACCOUNT_NAME».
Step 3 — Add the Merge Field in Microsoft Word
ACCOUNT_NAME).Important Note: This URL only displays the field names available for mail merge. You still need to go through the standard process of inserting a merge field in Microsoft Word. Custom fields are not visible in the URL output if the field's visibility is restricted for the end user at the record level.
000386295

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.