Apps Script Reference  (Create: Create new Spreadsheet | Create new Apps Script

Wednesday, September 20, 2023

Creating HTML with Google Apps Script(createHtmlOutputFromFile)

This is an example of code that creates a simple HTML page with Google Apps Script's HtmlService.createHtmlOutputFromFile().

The output HTML page will be as follows.

The script editor will look like this:
function doGet() {
return HtmlService.createHtmlOutputFromFile('index').setTitle("Title");

<!DOCTYPE html>
textarea {
width: 80vw;
height: 80vh;
font-size: 15px;
function myFunction() {
console.log("This is a log message.");


HTML Service: Create and Serve HTML

Related pages

Latest post

Extracting data from Google Sheets with regular expressions

Introduction Regular expressions are a powerful tool that can be used to extract data from text.  In Google Sheets, regular expressions ca...