使用alternate runtime开发Workspace add-on无法获取spreadsheet id如何解决
我正在使用alternate runtime开发一款Workspace扩展,已配置该扩展适配电子表格,需要在用户打开扩展时获取电子表格ID。为了测试,我创建了一个承载业务逻辑的云函数。
我的deployment.json文件内容如下:
{ "oauthScopes": ["https://www.googleapis.com/auth/spreadsheets.currentonly", "https://www.googleapis.com/auth/drive.file"], "addOns": { "common": { "name": "My Spreadsheet Add-on", "logoUrl": "https://cdn.icon-icons.com/icons2/2070/PNG/512/penguin_icon_126624.png" }, "sheets": { "homepageTrigger": { "runFunction": "cloudFunctionUrl" } } } }
但我实际收到的请求似乎是空的,没有包含当前打开的电子表格的ID,而根据官方文档说明,我本应获取到该电子表格ID。
请问我还需要做其他配置吗?
相关的代码非常简单,我仅打印了请求内容:
exports.getSpreadsheetId = function addonsHomePage (req, res) { console.log('called', req.method); console.log('body', req.body); res.send(createAction()); };
日志中显示的信息如下:
sheets: {}
更新 此问题是工程团队的已知问题,可在官方问题追踪平台查看对应工单。
内容的提问来源于stack exchange,提问作者Francesca
相关产品推荐
相关产品推荐

