Loading

Unable to Use Lookup Fields as Merge Fields in Salesforce Email Templates

Publiseringsdato: May 4, 2026
Beskrivelse

When creating an email template in Salesforce, lookup fields are not available as merge field options in the merge field selector. This is a current platform limitation. A custom formula field workaround can be used to pull the value of a lookup field and expose it as a usable merge field in your email template.

Løsning

Merge fields do not currently support lookup fields in Salesforce email templates. However, you can work around this limitation by creating a custom formula field that references the lookup field's value. Once created, this formula field is available as a merge field in your email templates.
Steps to Create a Formula Field as a Merge Field

  1. Go to Setup | Object Manager | [Select the object that contains the lookup field].
  2. Click Fields & Relationships.
  3. Click New.
  4. Select Formula for the Data Type and click Next.
  5. Give the field a name and select Text for the Return Type.
  6. Click Next.
  7. Using the Insert Field button, reference the lookup field value you want to use.

For example, if you have a custom object related to Accounts and you want to use the Account Name, click Insert Field, select Account > Account Name, and insert it into the formula box.

  1. For Blank Field Handling, select Treat blank fields as blanks.
  2. Complete the remaining steps using defaults or modify as needed, then save.

Note: This custom formula field does not need to be added to the page layout, but users still need to have access to it.

  1. Once the formula field is created, you can use it as a merge field in your email template.

NoteMerge Field Tips

Knowledge-artikkelnummer

000381076

 
Laster
Salesforce Help | Article