class HtmlService method .evaluate()

HtmlService is the Apps Script service.

.evaluate() is the method name you will see after a dot in your code.

What it does

Renders a template into final HTML output.

Why it's used

  • Turn a template into HTML the user actually sees.
  • Final step before showSidebar or showModalDialog.

Common errors

  • Forgetting parentheses on evaluate. Write HtmlService.evaluate(), not HtmlService.evaluate or evaluate by itself.
  • Skipping dots between chained calls. Each step needs a dot, like HtmlService.evaluate().
  • Adding spaces where they do not belong. Write HtmlService.evaluate(), not HtmlService .evaluate(), HtmlService.evaluate (), or HtmlService . evaluate().
  • Wrong capitalization. Use HtmlService and evaluate, not htmlservice or evaluate.

Explore

Related methods

Better Sheets tutorials

No tagged tutorials yet. Fetch Apps Script from the harvest table and this page fills automatically.

Related blog posts

Written guides about HtmlService.evaluate().

Browse the blog