Search code examples
google-apps-scriptgoogle-drive-api

How can I prompt a user to save the newly auto-created google doc to a google drive location of their choice


I've created a google apps-script script to create a google document report based on the filtered options in a google sheet. The report generation is started from the google sheet. I can create the required google document report but would now like to prompt the user to save it to a specific google drive location of their choice using the google drive Move To menu option. When the report is generated, I'd like a prompt to appear stating "Save Report to.." and the user is then displayed the google drive prompt as per this example

Google Drive Move To menu screenshot

and can then select where they want to save it on google drive. Any and all help appreciated.

If the google drive menu options are not integrated, is there another way to prompt the user so they can select which location to store the doc?


Solution

  • Very few built-in user interface menu options are integrated with Google Apps Script, actually most built-in user interface dialogs can't be open by using Google Apps Script but you might use the Google Apps Script HTML service to build your own dialogs.

    To help you create your own dialog to handle files in Google Drive you might use Google Picker.

    Resources