Executing Google Apps Script Functions from Mobile App
I'm developing a interface for a user who uses a google spreadsheet as his database. Nowadays he uses the Google Sheet mobile App (Android and IOs) to update his spreadsheet, and I just can't find any way to create a interface or even call a function on the mobile app. Does anyone knows how can I call a function from the script I've created on the Google Sheets Mobile app? Thanks!
Solution of the problem
The following work with the mobile versions of Google sheets:
Custom functions
onEdit
simple/installed triggeronChange
triggeronSelectionEvent
trigger(Works partially, if sheets is also open in desktop)
Notes:
Avoid calls to get
active
:getActive()
sheet, range or cell. These don't work in mobile or they return a default value like A1 in the first sheet for range.Avoid calls to
ui
:getUi()
. These have no meaning in the context of mobile app and won't work. This includes calls to alerts/prompts. More than likely, You'll hit execution timeout because alerts will wait for user input and this won't show up in mobile. If you do want to show some message, Here is a excellent workaround using images to do the same.Avoid calls to
HtmlService
. Sidebars/Modal dialogs are not supported in mobile versions.Buttons/Menu items don't work.
The best way to support apps script is mobile apps is to chain
onEdit
calls to a checkbox. Click here for a sample.
Commentaires
Enregistrer un commentaire