How to Use Variable Fields in your Mail Merge Email Templates

Mail Merge for Gmail lets you send the same email message to a group of recipients but as separate emails without having to use CC or BCC. You can use variable fields in your email template - these are enclosed in double curly braces like {{First Name}} - and the fields are directly mapped to columns of the Google Spreadsheet.

For instance, if you have a column in the spreadsheet as First Name, you can put {{First Name}} in the Gmail draft (variable enclosed in double curly braces) and it will be dynamically substituted with the actual value of the first name in the outgoing email messages.

Formatting Error

Troubleshooting {{Variables}} in Mail Merge

Mail Merge will show an error when it cannot substitute the placeholder (or variable name) with actual values from the sheet. This happens in a few situations:

  1. The variable name used in the Gmail template does not exactly match the column title in the Google Spreadsheet.
  2. There’s no corresponding column in the Google sheet for the {{variable}} used in your Gmail template.
  3. The variable name in the Gmail template is formatted with multiple styles. For instance, if the variable name is {{Postal Address}}, you cannot have Postal using one style and Address using another formatting style.

How to Fix the Gmail Formatting Issue

The fix is relatively simple.

Open the corresponding draft in your Gmail Account, select the variable name with your mouse and click the Remove Formatting icon as shown in the screenshot below.

Alternatively, you can manually remove the variable and type it again. This will ensure that the entire variable is formatted in a single style.

Formatting Issue

Amit Agarwal is a web geek, solo entrepreneur and loves making things on the Internet. Google recently awarded him the Google Developer Expert and Google Cloud Champion title for his work on Google Workspace and Google Apps Script.

Awards & Recognition

Google Developer Expert

Google Developer Expert

Google awarded us the Developer Expert title recogizing our work in Workspace

ProductHunt Golden Kitty

ProductHunt Golden Kitty

Our Gmail tool won the Lifehack of the Year award at ProductHunt Golden Kitty Awards

Microsoft MVP Alumni

Microsoft MVP Alumni

Microsoft awarded us the Most Valuable Professional title for 5 years in a row

Google Cloud Champion

Google Cloud Champion

Google awarded us the Champion Innovator award for technical expertise

Want to stay up to date?
Sign up for our email newsletter.

We will never send any spam emails. Promise 🫶🏻