• Home

  • Productivity

  • App tips

App tips

3 min read

How to use variables in Google Docs

Google Docs variables let you fill in and edit multiple fields at once.

By Jessica Lau · August 18, 2023
Google Docs logo, which is a simplified illustration of a piece of paper with a dogeared corner.

When I worked at a law firm, I edited a lot of templated documents, like engagement letters, affidavits, and invoices. Because the law is the law, there was absolutely no room for error. My only strategy to ensure I filled in every document accurately was simply to be very, very careful. (I never said it was a great strategy.) 

Word processors like Google Docs have come a long way since. Now you can use variable chips in Google Docs to streamline the process of creating and editing templates. 

Here, I'll show you how to use Google Docs variables to build and fill in your template. 

What are Google Docs variables? 

Google Docs variable chips allow you to insert dynamic data, such as names, dates, and addresses, into your document. Then you can enter the value of the variable once, and Google Docs will update the rest. This way, you can fill in repeat fields at the same time, ensuring consistency throughout your doc.

Note: Google Docs variable chips are currently available only on eligible school or work Google accounts.

How to use variables in Google Docs 

There are a few ways to insert Google Docs variables. In my experience, this is the fastest way to do it. (I'll be using a dog adoption letter as my template.)

  1. Open your template (or a new document) in Google Docs. 

  2. Place your cursor where you want to insert a variable. Type @, and then click Variable (under the Smart Chips section) or enter Variable.  

    How to insert Google Docs variables.

  3. In the Variables menu, click Insert new variable

    How to insert a new Google Docs variable.

  4. In the Create variable window that appears, enter a recognizable Variable name. Then click Create

    Create variable window in Google Docs with a field to add a variable name.

  5. To set the variable value (the text that displays for that variable in this particular version of your template), click the area where it says No value for that variable chip.

    Google Docs variables panel with the no value area for a variable highlighted.

  6. Google Docs will add a thick outline around the first instance of that variable directly in the document and highlight subsequent occurrences. Enter the value in the first instance. In this example, I've entered the name of the soon-to-be-adopted dog, Taco

Demo of how to add the value for a Google Docs variable. When the value for one variable is updated, all remaining instances automatically update to match.

Note: Google Docs automatically modifies the variable text to match the surrounding text format. For example, if the surrounding text is bolded, your variable text will also be bolded. 

That's it! Just rinse and repeat the above steps to add new variables to your template. 

Changing a variable in Google Docs

Ideally, lots of dogs are getting adopted. Each time you're sending out an adoption letter, all you have to do is edit one variable in the doc, hit Enter, and every other instance automatically updates to match.

Demo of how to update the value of a Google Docs variable, so that it automatically updates every instance throughout the doc.

Note: You can only edit the variable value in the document—not in the Variables panel. 

Use cases for Google Docs variables 

There are endless ways you can use variable chips in Google Docs to streamline your daily workflows. Here are a few ideas to get you started. 

  • HR and recruiting. If you have templated letters, like job offers and termination agreements, use variables to update the recipient's name and start or end date.  

  • Marketing. Update templated marketing emails, like welcome messages and feedback requests, with the customer's name and relevant links.   

  • Accounting. Sending invoices? Use variables to automatically populate repeat instances of the amount owing and the payment due date.

  • eCommerce. If you're sending post-purchase emails, like confirmation messages and thank yous, use variables to update the product name and order number.  

Automate Google Docs 

Variable chips in Google Docs are handy—but they're still a few features short of fully automating the process of filling in document templates. 

With Zapier, you can connect Google Docs to thousands of other apps, including Google Sheets and Google Forms. This way, you can automatically do things like populate a Google Docs template and create new templates based on form responses

Here are a few workflows to get you started. 

To get started with a Zap template—what we call our pre-made workflows—just click on the button. It only takes a few minutes to set up. You can read more about setting up Zaps here.

Copy data from new Google Sheets rows to a Google Doc template

Copy data from new Google Sheets rows to a Google Doc template
  • Google Sheets logo
  • Google Docs logo
Google Sheets + Google Docs

Create Google Docs from template for new Google Forms responses

Create Google Docs from template for new Google Forms responses
  • Google Forms logo
  • Google Docs logo
Google Forms + Google Docs

Create Google Docs documents from SurveyMonkey survey entries

Create Google Docs documents from SurveyMonkey survey entries
  • SurveyMonkey logo
  • Google Docs logo
SurveyMonkey + Google Docs

Related reading: 

  • How to create Google Docs templates based on form responses

  • How to compare two Word documents

  • How adding document automation to your workflows helps your business

  • How to do subscript and superscript in Google Docs

Get productivity tips delivered straight to your inbox

We’ll email you 1-3 times per week—and never share your information.

tags

Related articles

Improve your productivity automatically. Use Zapier to get your apps working together.

Sign up
See how Zapier works
A Zap with the trigger 'When I get a new lead from Facebook,' and the action 'Notify my team in Slack'