从移动应用程序执行 Google Apps 脚本函数 [英] Executing Google Apps Script Functions from Mobile App

查看:27
本文介绍了从移动应用程序执行 Google Apps 脚本函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为使用谷歌电子表格作为数据库的用户开发一个界面.现在他使用 Google Sheet 移动应用程序(Android 和 IOs)来更新他的电子表格,而我找不到任何方法来创建一个界面,甚至在移动应用程序上调用一个函数.有谁知道如何从我在 Google Sheets Mobile 应用程序上创建的脚本中调用函数?谢谢!

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!

推荐答案

以下适用于移动版 Google 表格:

The following work with the mobile versions of Google sheets:

  • 自定义函数
  • onEdit 触发器
  • onSelectionEvent 触发器(部分工作,如果工作表也在桌面上打开)
  • Custom functions
  • onEdit trigger
  • onSelectionEvent trigger(Works partially, if sheets is also open in desktop)
  • 避免调用获取 active: getActive() 工作表、范围或单元格.这些在移动设备中不起作用,或者它们在范围的第一张工作表中返回默认值,如 A1.

  • 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.

避免调用ui:getUi().这些在移动应用程序的上下文中没有意义,也不会起作用.这包括对警报/提示的调用.很有可能,您会遇到执行超时,因为警报将等待用户输入,而这不会显示在移动设备中.如果您确实想显示一些消息,这里是使用图像来做同样事情的一个很好的解决方法.

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.

  • 避免调用 HtmlService.移动版本不支持侧边栏/模态对话框.

  • Avoid calls to HtmlService. Sidebars/Modal dialogs are not supported in mobile versions.

按钮/菜单项不起作用.

Buttons/Menu items don't work.

支持应用程序脚本的最佳方式是移动应用程序是将 onEdit 调用链接到复选框.点击此处查看示例.

The best way to support apps script is mobile apps is to chain onEdit calls to a checkbox. Click here for a sample.

这篇关于从移动应用程序执行 Google Apps 脚本函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆