Loading

How to Find Salesforce Record Field Names for Mail Merge Templates Using a URL

게시 일자: May 31, 2026
상세 설명

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>

  • Replace <org domain> with your Salesforce org instance (for example: na1, na2, or mydomain.my if My Domain is enabled).
  • Replace <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

  1. In Microsoft Word, navigate to Insert > Quick Parts > Field.
  2. Select Merge Field.
  3. Paste the field name from the URL output (for example, 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.

Knowledge 기사 번호

000386295

 
로드 중
Salesforce Help | Article