我收到了名为的变量的未定义:名称有关为什么它不显示结果的任何帮助.在按下搜索后,它将显示在记录器中,但不会显示在index.html或Web端.
码:
// var names =[]; //I tried using a global variable but with no luck
function SearchFiles(searchTerm) {
var searchFor = "title contains '" + searchTerm + "'";
var owneris = "and 'Email@email.com' in Owners";
var names = [];
var fileIds = [];
Logger.log(searchFor + " " + owneris);
var files = DriveApp.searchFiles(searchFor + " " + owneris);
while (files.hasNext()) {
var file = files.next();
var fileId = file.getId(); // To get FileId of the file
fileIds.push(fileId);
var name …
Run Code Online (Sandbox Code Playgroud)