0

I need help with my code. I'm making an appscript to validate some IDs with Google Sheets.

I'm watching this tutorial, I followed the steps and I get this error, I watch the video and it's the same, I don't know what it could be

the error is

SyntaxError: Unexpected token '=' (línea 4, archivo "Código")

function doGet() {

  var template = HtmlService. createTemplateFromFile('index');
  var html = template.evaluate();
  return html;
}

function include( fileName ){
  return HtmlService.createHtmlOutputFromFile( fileName ).getContent();


}

function verificarPassword( form ){

  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheetUsuarios = ss.getSheetByName('Usuarios');
  var datausuarios = sheetUsuarios.getUsuarios.getDataRange().getValues();
  var sheetVentas = ss.getSheetByName( 'Ventas' );
  var dataVentas = sheetVentas.getDataRange().getDisplayValue();


  for( var i in datausuarios){
    if( dataUsuarios[i][1] == form.usuario && dataUsuarios[i][2] == form.contrasena ){
      var usuario = {
        headers : dataVentas[0],
        nombre: dataUsuarios[i][0],
        ventas:''
      }

      for( var fila in dataVentas ){

        if( dataVentas[fila][0] == usuario.nombre){

          usuario.ventas = dataVentas[fila];
          break;

        }
        return usuario;
      }


    }
    throw( 'La contrasñea es incorrecta')
  }


}
James Z
  • 12,209
  • 10
  • 24
  • 44
  • 1
    `HtmlService. createTemplateFromFile('index');` there's a space which might be the reason – Sudhir Bastakoti May 05 '23 at 15:20
  • Hi thanks. Look when I implement the web App it gives me the following error: SyntaxError: Unexpected token '=' (line 4, "Code" file) It tells me that the error is in line 4 because of the "=" sign, I don't know how to solve it the code i have is function doGet() { var template = HtmlService.createTemplateFromFile('index'); var html = template.evaluate(); return html; } the 4 line is: var html = template.evaluate(); – José Andrade May 05 '23 at 16:52

0 Answers0