Still fairly new to google app scripts and saw a great class with crappy documentation.
https://developers.google.com/apps-script/class_docslistdialog. I’m hoping to use this to allow my users to select a document from their Google collection.
Here’s what I’ve started:
var app = UiApp.createApplication().setHeight(400).setWidth(600);
var ss = SpreadsheetApp.getActiveSpreadsheet();
var doclisthandler = app.createServerHandler('selectionhandler');
var doclist = app.createDocsListDialog().showDocsPicker().addSelectionHandler(doclisthandler);
ss.show(app);}
function selectionhandler(e)
{ var app = UiApp.getActiveApplication();
var selname = e.parameter.doclist;
toastDoc.toast(selname,'here in selectionhandler',4);
return app;
}
My toastDoc.toast is just to verify my selectionhandler function works and see what is returned. selname returns ‘undefined’.
I’ve looked for examples on this class other than what’s in the url from above, but I got nothing 🙁
Ideally, I’d like to return the document id that is selected so that my script can do further processing…
Any assistance would be appreciated
To check what it returns, you can use below function. Everything will be returned in Logger
Hope that helps