Login with Google Sheets

OK

In your google spreadsheet, use the first column (A) for the username, column (B) for password, and column (C) for name.

Update your google apps script to this:

///// check username and password and return output
function doGet(e) {
  var message = "";
  var ss = SpreadsheetApp.openById(e.parameter.sheetId);
  var sh = ss.getSheetByName(e.parameter.gridName);
  var rg = sh.getName() + "!" + sh.getDataRange().getA1Notation();
  var sql = e.parameter.query;
  var qry = '=query(' + rg + ',\"' + sql + '\",0)';
 
  var ts = ss.insertSheet();
  var setQuery = ts.getRange(1,1).setFormula(qry);
  var getResult = ts.getDataRange().getValues();
  ss.deleteSheet(ts);
  
  if (getResult[0][0] == "#N/A") {
  message = 'username not present';
  } else {
  if (getResult[0][1] != e.parameter.pwd) {
  message = 'incorrect password';
  } else {
  message = getResult[0][2];
  }
  }
  return ContentService.createTextOutput(message);
}

the only change being the message value from signed in to getResult[0][2]

Update your google apps script with a new version, and you should be good to go.

In your app, when the name is returned as response content, set this to the label where you want to display the name.

@TIMAI2 Thank you verymuch for your kind help... Keep up your good work. God bless you!!

1 Like