Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
107 views
in Technique[技术] by (71.8m points)

android - 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!

Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The following work with the mobile versions of Google sheets:

  • Custom functions
  • onEdit trigger
  • onSelectionEvent 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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...