本文介绍了DriveApp 错误:“很抱歉,发生服务器错误.请稍等,然后重试."的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我运行以下函数时

    function getDatabases(){
      var files = DriveApp.getFilesByType(MimeType.GOOGLE_SHEETS);
      var amount = 0;
      while (files.hasNext()){
        if((files.next().getName()).indexOf("Database") > -1){
          amount++;
        }
      }
      return amount;
    }

我收到此错误:

这突然开始于大约一个半月前.相同的代码之前运行,所以我认为我达到了配额限制,但事实并非如此.

This suddenly started about a month and a half ago. The same code was working earlier so I thought I reached a quota limit but that was not the case.

推荐答案

得到了我的解决方案在脚本中->资源 ->高级谷歌服务->打开云端硬盘 API点击下方消息"Google Cloud Platform API 仪表板"为脚本打开 de cloud 项目.选择项目后,在搜索栏中搜索Drive API";->启用,对Google Drive API"执行相同操作.完成,不再是我们很抱歉服务器错误"用于脚本中的 DriveApp 函数.另外:我启用了其他 API 和高级服务 Drive Activity API,以防万一……

got my solutionIn the script -> Resources -> Advanced google services -> turn on Drive APIClick in below message " Google Cloud Platform API Dashboard" to open de cloud project for the script. With the project selected, search in the search bar "Drive API" -> ENABLE, do the same for "Google Drive API".Done, no more "we're are sorry server error" for DriveApp functions in the script.Also: I enabled other APIs and advanced services Drive Activity API, just in case...

这篇关于DriveApp 错误:“很抱歉,发生服务器错误.请稍等,然后重试."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 12:16