用户无法再在 Google 表格中运行宏来刷新数据连接

发布于 2025-01-14 04:53:04 字数 675 浏览 4 评论 0原文

我在 Google Sheets 中构建了一个连接到 Big Query 的仪表板。有一系列过滤器将参数传递给连接脚本,还有一个按钮,一旦用户做出过滤器选择,就会触发所有连接的刷新。今天,我的用户在尝试刷新连接时开始遇到错误。该错误只是说“脚本 extract_refresh 遇到了错误详细信息”,展开详细信息只是重复相同的错误消息。我仍然能够刷新仪表板(当使用我的帐户登录时),没有任何问题,这表明这是用户帐户的问题,而不是文件或脚本的问题。然而,据我所知,宏、仪表板文件和用户访问权限都没有发生任何变化。有什么想法吗?

更多信息:

  • 用户在 IAM 中拥有项目的“编辑者”角色

  • 我拥有“所有者”角色

  • Big Query 表由存储在 Google Cloud Storage 中的 CSV 文件提供

  • 失败的按钮调用的宏粘贴在下面:

    函数 extract_refresh() {
        var电子表格 = SpreadsheetApp.getActive();
        电子表格.getRange('A2').activate();
        SpreadsheetApp.enableAllDataSourcesExecution();
        电子表格.refreshAllDataSources();
    };
    

I have built a dashboard in Google Sheets that connects to Big Query. There are a series of filters that pass parameters to the connection scripts and a button that triggers a refresh of all connections once the user has made their filter selections. Today my user started experiencing an error when trying to refresh the connections. The error simply says "Script extract_refresh experienced an error Details" expanding the details simply repeats the same error message. I am still able to refresh the dashboard (when logged in with my account) without any issues which suggests it's an issue with the user's account rather than the file or the script. However, as far as I am aware nothing has changed with the macro, the dashboard file, nor the user access permissions. Any ideas?

A bit of further info:

  • User has an 'Editor' role in IAM for the project

  • I have an 'Owner' role

  • Big Query tables are fed by CSV files stored in Google Cloud Storage

  • The macro called by the button that is failing is pasted below:

    function extract_refresh() {
        var spreadsheet = SpreadsheetApp.getActive();
        spreadsheet.getRange('A2').activate();
        SpreadsheetApp.enableAllDataSourcesExecution();
        spreadsheet.refreshAllDataSources();
    };
    

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烟火散人牵绊 2025-01-21 04:53:04

问题解决了 - 事实证明 Google 已将该用户从其帐户中注销。他们使用的是链接到他们的电子邮件地址的 Chrome 浏览器配置文件,并且加载的仪表板文件没有问题,因此似乎已登录。但是,在屏幕右上角有一个“登录”按钮,而不是“共享”按钮。该帐户已注销,因此不会授权他们运行该脚本。

Problem solved - it turns out Google had signed the user out of their account. They were using the Chrome browser profile linked to their email address and the dashboard file loaded without issue so it appeared to be signed in. However in the top right of the screen there was a 'sign in' button instead of the 'share' button. The account was signed out and hence would not authorise them to run the script.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文