In here I am trying to pass/get a variable from Code.gs to NewFile.gs. I would like to pass a folderIdwhich i get it from input box and use it in different file gs instead of inserting manually.
Here is the code:
Code.gs
if (userInput == "yes") {
var folderId = Browser.inputBox('Enter folder ID', Browser.Buttons.OK_CANCEL);
}
var parent = DriveApp.getFolderById(folderId);
var parentName = DriveApp.getFolderById(folderId).getName();
NewFile.gs
function newFileUpdate() {
var parent = DriveApp.getFolderById("folderId from input box");
var parentName = DriveApp.getFolderById("folderId from input box").getName();
getChildFiles(parentName, parent);
getRootFiles(parentName, parent);
}
So i would like to know a simple way for me to get the folder id from code.gs into NewFile.gs