How to Use Template {{Markers}} in Document Studio

Published in: Document Studio

Your Document Studio templates can include any variable field that is available as a column title in the Google Sheet. In case of Google Forms, you can use any question title as your marker and the marker should be exactly as your question title enclosed in double curly braces.

For instance, if a question in your Google Form says “What is your name”, the marker you’ll use in your document template will be {{What is your name}}.

You can also create additional columns in the source Google Spreadsheet with formulas and use them as dynamic markers in your Google template. Let me show you an example.

Create a new column and call it Row Number. Now go to the first empty cell of that column and put this ArrayFormula function:

=ArrayFormula(if(LEN(A2:A); row(A2:A) -1;))

What we have added a column that displays the row number of the rows and we can now put {{Row Number}} in your document templates, merged file names and Drive folder path. For instance, if you put Invoice #{{Row Number}} in the file name, the files name would be named Invoice #1, Invoice #2 and so on automatically.

Formatting Date and Time

The same technique can be used to format date and time information for including in your templates.

Say the first column in your Google Sheet in called Timestamp and it includes the date and time when a Google Form response was submitted. Add a new column called Submission Time and add this formula in the first empty cell.


You can now include the submission time in your email and document template using the {{Submission Time}} variable field.

Standard Markers for Google Forms

In addition to standard form questions and column headers, Google Forms also support a few standard markers like:

  • {{Response Number}} - Form Response number
  • {{Form Name}} - The name of the Google Form
  • {{Form Url}} - A link to the associated Google Form
  • {{Response Id}} - Unique response ID generated by Google Form
  • {{Response Url}} - Directly link to view / edit the current form submission
  • {{Response Date}} - The full timestamp when a form was submitted
  • {{Respondent Email}} - If your Google Form is capturing email addresses, this will include the email address of the form respondent.
  • {{All Markers}} - An HTML table containing all the form responses in a neat tabular format.

You should put {{All Answers}} in your email body to receive a copy of the form answers in an email notification.

📮  Subscribe to our Email Newsletter for Google tips and tutorials!
Published in: Document Studio

Looking for something? Find here!

Meet the Author

Web Geek, Google Developer Expert
Amit Agarwal

Amit Agarwal is a Google Developer Expert in Google Workspace and Google Apps Script. He holds an engineering degree in Computer Science (I.I.T.) and is the first professional blogger in India. He is the developer of Mail Merge for Gmail and Document Studio. Read more on Lifehacker and YourStory

Get in touch

Google Add-ons

Do more with your Gmail and GSuite account

We build bespoke solutions that use the capabilities and the features of Google Workspace for automating business processes and driving work productivity.

  1. Mail Merge with Attachments
    Send personalized email to your Google Contact with a Google Sheet and Gmail
  2. Save Emails and Attachments
    Download email messages and file attachments from Gmail to your Google Drive
  3. Google Forms Email Notifications
    Send email notifications to multiple people when a new Google Form is submitted
  4. Document Studio
    Create beautiful pixel perfect documents merging data from Google Sheets and Google Forms
  5. Creator Studio for Google Slides
    Turn your Google Slides presentations into animated GIFs and videos for uploading to YouTube