Google Sheets userform different views not loading


This Content is from Stack Overflow. Question asked by Luan AlgumGamer

i´m currently new to sheets coding, i´ve been following this tutorial in order to create a userform, the problem is when i get to approximately 19:03 of the video, my view of “Search” tab doesn´t seem to work, below are my codes:

function loadMainForm() {
  const htmlServ = HtmlService.createTemplateFromFile("main");
  const html = htmlServ.evaluate();
  const ui = SpreadsheetApp.getUi();
  ui.showModalDialog(html, "Editar informações dos prescritores")


function createMenu(){

  const ui = SpreadsheetApp.getUi();
  const menu = ui.createMenu("Custom Menu");
  menu.addItem("Open Form", "loadMainForm");

function onOpen(){




<h1>Add Customers</h1>


<!doctype html>
<html lang="en">
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
      .nav-link {
    <div class="container"> 
      <ul class="nav nav-tabs">
        <li class="nav-item">
          <div class="nav-link active" id="home-link">Home</div>
        <li class="nav-item">
          <div class="nav-link" id="search-link">Search</div>
        <li class="nav-item">
          <div class="nav-link" id="add-customer-link">Add Customer</div>

      <div id="app"></div>

    <!-- Optional JavaScript -->
    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    <script src="" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
    <script src="" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
    <script src="" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>

      function loadSearchView(){{
          document.getElementById("app").innerHTML = html;


function loadPartialHTML_(partial) {
  const htmlServ = HtmlService.createTemplateFromFile(partial);
  return htmlServ.evaluate().getContent();

function loadSearchView(){

  return loadPartialHTML_("search");


function loadAddCustomersView(){

  return loadPartialHTML_("addcustomers");


I´ve already tried rewriting the code 3 times, and nothing seems to work, when i open the console, an error appears as the following image

If someone could please help me figure out what I did wrong, I would be very grateful


This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?