Skip to content Skip to sidebar Skip to footer

Web App To Return Boolean Result To Html From Checking Data In Spreadsheet

I have html page and script for check, the project deployed like web app In included 'index-js.html' I have this this code send question to the apps script server where I have th

Solution 1:

google.script.run

google.script.run is an asynchronous client-side JavaScript API

Your need a handler to handle the result.

Also the two log lines should be put in it also.

var findLogin;
functiononSuccess(_findLogin) {
    console.log(ev.target.value);
    console.log(_findLogin);
    findLogin = _findLogin;
 }

Solution 2:

Another possible reason about 'delay' may be due to the ineffective code.

getRange("A:A") would also get the rows that are blank.

For example, a default sheet has 1000 rows and it would get A1:A1000.

May be you would change to getRange(1, 1, sheetTo.getLastRow(), 1) or break the for loop when the cell is blank (in case there is no blank cell in between).

However, the following change may be most effective (may be can integrate with getLastRow)

functionsearchLogins(login){
  let sheetApp = SpreadsheetApp.getActiveSpreadsheet();
  let sheetTo = sheetApp.getSheetByName("SISTEM");
  let findingRLGN = sheetTo.getRange("A:A").getValues().flat();
  return findingRLGN.indexOf(login) !== -1;
}

Post a Comment for "Web App To Return Boolean Result To Html From Checking Data In Spreadsheet"