class HtmlService method .createHtmlOutputFromFile()

HtmlService is the Apps Script service.

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

What it does

Loads HTML from a file in the script project.

Why it's used

  • Load a polished UI from an Html file in the project.
  • Keep markup out of your .gs code for easier editing.

Common errors

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

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.createHtmlOutputFromFile().

Browse the blog