createDocsListDialog setInitialView error
google-apps-script
Solution
From the code completion itself you can see that the `setInitialView` function does not expect a string as parameter, but a FileType constant. On the docs you can see it is called `SPREADSHEETS`.
Here is how it works:
app.createDocsListDialog().showDocsPicker().
addSelectionHandler(doclisthandler).setInitialView(UiApp.FileType.SPREADSHEETS)
Problem
Back again with the createdocsListDialog function :) I've got it working however, I'd like to limit the files to be selected to be only spreadsheets. "Error encountered: Cannot find method setInitialView(string). (line 13)" The .setInitialView appears in the script editor as a method, but when running.. not so much. Here's the code. `var doclisthandler = app.createServerHandler('selectionhandler'); var doclist = app.createDocsListDialog().showDocsPicker() .addSelectionHandler(doclisthandler).setInitialView('spreadsheet');` Any ideas?