có thể getValue không trả về string nên không dùng touppercase được. nhét thêm tostring() rồi mới touppercase() vô thử.
function doGet(e) {
return HtmlService.createHtmlOutputFromFile('code');
}
function AddRecord(firstname, lastname, address, city, state, zip) {
var url = '
//https://docs.google.com/spreadsheets/d/1_Yu5dD-f6Fb73-hUGfaAnIyemB0yMKCKIBN9LxjEr0o/edit?usp=sharing
var ss= SpreadsheetApp.openByUrl(url);
var webAppSheet = ss.getSheetByName("DATA");
webAppSheet.appendRow([firstname, lastname, address, city, state, zip, new Date()]);
}
function checkLogin(username, password) {
var url = '
//https://docs.google.com/spreadsheets/d/1_Yu5dD-f6Fb73-hUGfaAnIyemB0yMKCKIBN9LxjEr0o/edit?usp=sharing
var ss= SpreadsheetApp.openByUrl(url);
var webAppSheet = ss.getSheetByName("USERNAMES");
var getLastRow = webAppSheet.getLastRow();
var found_record = '';
for(var i = 1; i <= getLastRow; i++)
{
if(webAppSheet.getRange(i, 1).getValue().toUpperCase() == username.toUpperCase() &&
webAppSheet.getRange(i, 2).getValue().toUpperCase() == password.toUpperCase())
{
found_record = 'TRUE';
}
}
if(found_record == '')
{
found_record = 'FALSE';
}
return found_record;
}
code đấy ạ
Bác sửa giúp e với