I have a library containing a webApp (using UiApp with doGet) intended to work with a specific spreadsheet from each user of that library.
How a user of that library could pass the Id of his own spreadsheet to the library?
Thanks
Notes about the current code, on the library (myLib)
var mainDoc = SpreadsheetApp.openById("abc123"); // should be user's spreadsheet Id
function mainUiApp() {
// something here using handler1 below
return app;
}
function handler1() {
// using mainDoc spreadsheet
}
Notes about the current code, on the user of myLib
var mainDocClient = SpreadsheetApp.openById("xyz789");
function doGet() {
return myLib.mainUiApp();
}
You can pass a spreadsheet ID as a parameter of the
mainUiAppfunction. Here is an exampleThe
myLibcode isUser code is