Google apps script 谷歌表单到firebase

Google apps script 谷歌表单到firebase,google-apps-script,google-sheets,google-cloud-firestore,Google Apps Script,Google Sheets,Google Cloud Firestore,我正试图将我的表格数据发送到firestore应用程序,但出现了这样的错误 继续显示:TypeError:无法读取null的属性“getLastRow”(第14行,文件“Code”) 我完成了所有配置,并将firestore库添加到应用程序脚本中 function covidFunc() { const email = "myproject@appspot.gserviceaccount.com"; const key = "-----BEGIN PRI

我正试图将我的表格数据发送到firestore应用程序,但出现了这样的错误 继续显示:TypeError:无法读取null的属性“getLastRow”(第14行,文件“Code”)

我完成了所有配置,并将firestore库添加到应用程序脚本中

function covidFunc() {
   const email = "myproject@appspot.gserviceaccount.com";
   const key = "-----BEGIN PRIVATE KEY--------END PRIVATE KEY-----\n";

   const projectId = "my project id";
   var firestore = FirestoreApp.getFirestore (email, key, projectId);
  
  
  // get document data from ther spreadsheet
   var ss = SpreadsheetApp.getActiveSpreadsheet();
   var sheetname = "US-covid";
   var sheet = ss.getSheetByName(sheetname); 
   // get the last row and column in order to define range
   var sheetLR = sheet.getLastRow(); // get the last row }



  [1]: https://i.stack.imgur.com/4Nw6k.png

您的活动电子表格文件;您的google apps脚本项目所连接的应用程序应该有一个标签/工作表,其名称为:
US covid
。您的屏幕截图只提供了一个名为US covid的电子表格文件。但是选项卡/工作表应该有它

例如:


再次检查您的活动电子表格是否正确;你把这个项目附加到的那个,有一个表/标签,名字是:“US covid”。我做了是的,它有相同的名字。你也可以附加一个屏幕截图,显示标签的名称和这个标签的一些数据可能吗?好的,我只写了一行测试完全感谢你!只是那件小事引起了问题