google.script.run problem on Google Apps Script
04:05 29 Jul 2021

I am working on a Google Apps Script project, and I have made a html form that will automatically paste the user answers in a sheet.

My problem is the following: I need to add elements in a drop down list with a separated form. To do this, I have made a function that will read some cells and add their value in a "list". I joined that list to return a string named listVlans.

This is my GS:

function returnList() {
  let ss = SpreadsheetApp.getActive();
  let VLANS = ss.getSheetByName("VLANS");
  let list = VLANS.getRange(3, 9, VLANS.getLastRow() - 2, 1).getValues();
  let listVlans = list.join();
  return listVlans;
}

There is no problem here, it returns a big string (listVlans) with all the elements of my list separated by ,.

My problem is that I would like to import this listVlans from the .gs to my html script to actualize my drop down list elements in function of my sheet's values.


The problem is that the console.log(newList) is just printing undefined, but it should print my big joined string...

javascript html jquery google-apps-script web-applications