All Collections
Getting Started with Groove!
Training Articles
What merge fields are supported in templates
What merge fields are supported in templates

Use merge fields in templates to pull in data specific to each person you're reaching out to

Amanda Jaramillo avatar
Written by Amanda Jaramillo
Updated over a week ago

Basics

When you create email templates, you usually want the template merged with dynamic values, such as the first name of the recipient. Groove follows the notation for merge fields that Salesforce templates are using.

Hi {!firstname},

Thanks for you interest in...

Groove will replace the merge field with the first name of the recipient. Recipients can be leads or contacts. You could also use a more explicit notation like:

Hi {!Contact.firstname},

or

Hi {!lead.firstname},

However, that's actually not necessary since Groove will always merge it with the field firstname regardless whether the recipient is a lead or contact. Also, notice how it doesn't matter whether you use lower case or upper case spelling.

You can use any field on the lead or contact object as long as you know the "API name" which is the technical name of a field in Salesforce. Groove's template editor helps you find that field using the merge field picker.

Custom fields are also fully supported. You can recognize those by the tailing "__c". Here for example, the lead object has a custom field where you track in which of your products the lead expressed interest.

Hi {!firstname},

Thanks for your interest in {!product_of_interest__c}.

If you were to merge that template with a contact as the recipient, the field would remain unmerged since the contact object doesn't have that field.

Account Fields

Besides fields on the lead or contact, you might also want to merge fields that aren't directly on the lead or contact but rather on an object that is directly related. The best example is the Account object: a contact usually has a parent account. Thus you could use:

Hi {!firstname},

You work for {!account.name}, specialized in {!Account.Industry}.

This template would merge the value of the contact's account name and account industry. Notice how that can only refer to a parent object (account is the parent object of contact).

By the way, if you use the merge field {!account.name} and merge the template with a lead, Groove would be smart enough and treat it as {!company} which is where the lead object stores the name of the company the person is working for - the equivalent of "Account Name". That rule also applies vice versa - so {!account.name} and {!company} are synonyms and always work for leads and contacts.

Opportunity Fields

You are also able to pull in information from the opportunities that your contacts are related to, in order to personalize each email based on the deal that you are working on:

Hi {!firstname},

I'd love to pick up our discussion around {!Opportunity.Description}, and explore whether our teams can work together!

However, since contacts can be related to multiple opportunities, Groove needs you to specify which opportunity you'd like to merge information from. The way to specify the opportunity comes from the way that you import the contact to the flow. There are 3 ways to do this:

  1. Advanced Search on Opportunities + Contacts

  2. Salesforce List View with an Opportunities + Contacts view

  3. Salesforce Report of Opportunities and Contacts

The example above is using an Advanced Search for Opportunities + Contacts. Sammy is selected from "Ralph's Opp" specifically, so even though Sammy might be in multiple opportunities, we have specified that Sammy, for the purposes of this flow, is connected to "Ralph's Opp". Therefore, all opportunity merge fields will now pull information from Ralph's Opp.

The above directions will also work to connect contacts to opportunities when you are auto-importing to flows, both via a Saved Search and a Salesforce Report.

Related Object Merge Fields

Depending on how your team's Salesforce organization is set up, you may have your contacts associated to custom objects, or maybe multiple accounts, or a combination of objects. With Groove, you can pull in merge fields from related objects by associating each person in a flow to a specific related object:

Flow Import Setup:

Option A: Use Advanced Search

  1. Choose your flow, and click Add People

  2. Navigate to Advanced Search, and choose the object combination that you'd like to import from.

    1. In the example below, we are searching up Contacts and their related Purchase Orders. Josee Rizall will be the contact imported to the flow, and associated to Order B for activity logging, and for related merge fields (explained below the screenshot)

Option B: Use a Salesforce report

  1. Choose your flow, and click Add People

  2. Navigate to Salesforce report, and choose your report

    1. Note: Your Salesforce report must have a column that includes the ID of the related object you want each person in the report to be mapped to

  3. Select and import the contacts you'd like to add to the flow

Merge Fields Setup:

  1. Edit your template and click on the {!...} icon to insert a merge field

  2. Search Related Object, and insert the Related Object Placeholder

  3. You should see {!RelatedObject.set_API_name_here}; replace the portion after the dot with the API name of the field you'd like to merge from the related object, and save your template.

In our example, we brought in the Name of the Related Object (Order B), and the result is shown below when executing the flow step:

Custom Lookup Fields on the Contact

Note: This feature is currently in Beta. Please ask your admin to reach out to your CSM if you'd like to have it enabled

Groove supports standard and custom lookup relationships on the Contact object. While there is a standard relationship between Account and Contact, you could also have custom relationships on the Contact object. For example, imagine you have this data model:

  1. One Account can have many Contacts (that's standard)

  2. You have a custom object "Office Building" (API name is "Office_Building__c"). You use the standard field "Name" for the building's name and a custom field City" for where the building is located (API name is "city__c").

  3. One Office Building has many Contacts (which is where the contacts work). Therefore there is a lookup field on the contact "Main Office" which points to one of your Office Building records (API name "Main_Office__c").

Now you can create a template like this:

Hi {!firstname},

You work at {!Main_Office__r.Name} in {!Main_Office__r.city__c}, right?

When merged with a contact that has the field "Main Office" populated, it would merge the template with the name of the contact's office building and city. Two things are worthwhile knowing:

  1. It doesn't say {!Main_Office__c.Name} - so instead of the "__c" it says "__r". This is a Salesforce standard for indicating relationships (rather than field names).

  2. It doesn't say {!Office_Building__c.Name} or {!Office_Building__r.Name} since there is no such field (or relationship) on the contact object. One must not confuse the field name of a lookup field with the name of the object the lookup field is referring to.

User Merge Fields

There are other special merge fields that you might find useful.

Imagine you create a template and share it with other users. If you put your own name or phone number in the signature, other users couldn't really use it. Thus you can do:

Hi {!firstname},

This is {!User.firstname}. You can reach me by dialing {!user.phone}.

This would merge the template with the user's first name and phone number according to what they have stored in their Salesforce user record. So it always works for whoever is using the template.

Fallback Merge Fields

Sometimes your Salesforce data may be incomplete and you have to manually edit your merge fields before sending emails out. That is why we created a safety proof feature called "Fallback Merge Fields". This allows you to type in a fallback field that will populate your merge field when Salesforce data is missing. 

For instance you may be have inserted {!firstname} but Salesforce does not have data on your contact's first name. Use "there" so when you send out your email the text shows as "Hey there."

Unsubscribe Links

When you send emails via Groove Flow, you might want to also include a link to Groove's unsubscribe facility. If you add this:

{!Unsubscribe.Click here to unsubscribe.}

This is what will populate for your recipient:

Clicking on the link will remove them from the flow and will set the Salesforce field "Email Opt Out" to true. This works for both leads and contacts.

See related: How to include Custom Merge fields (based on information that isn't in Salesforce)

Did this answer your question?