首页 文章

从Google表格到网站导入单元格值?

提问于
浏览
1

我想知道是否可以从谷歌表格导入一个单元格值到网站?谢谢大家的帮助!

1 回答

  • 0

    可能有几种方法可以做到这一点 . 我会将HTTP请求发送到返回单元格值的独立应用程序脚本内容服务脚本 . 在Apps脚本中编写程序:

    Apps Script Link

    创建一个doGet()函数:

    function doGet() {
      //This Apps Script is Used to get a cell value out of a spreadsheet
    
      var theSpreadSheet = SpreadsheetApp.getFileById('Your File ID');
      var theSheet = theSpreadsheet.getSheetByName('sheet name');
      var theCell = theSheet.getRange("A1");
      var theContent = theRange.getValue();
      return ContentService.createTextOutput(theContent);
    };
    

    我不知道您是打算使用服务器端代码,还是JavaScript AJAX请求,或者您的网站用于服务器端代码 .

相关问题