Search code examples
google-apps-scriptgoogle-app-maker

When a file is uploaded to the Google Drive, how do you handle that event (call scripts)?


In Google App Maker, can you check when a file is uploaded in the Google Drive Picker widget? I am trying to call scripts based on the event, when a clicks UPLOAD after selecting a file and successfully uploads a file to the Google Drive. In Google App Maker, the only events are onAttach, onDetach, onDataLoad, onDocumentSelect, onCancel, and onPickerInit. Thanks.


Solution

  • onDocumentSelect event is fired both when user selects existing file or uploads a new one. Information about the selected/uploaded file(s) can be found in the result object that is passed as a parameter to the event. Here is a link to the Drive Picker widget docs - https://developers.google.com/appmaker/ui/input-widgets#drive-picker