Hi Omer. I get error TypeError: Cannot read property 'getId' of null
Please tell me what is causing this error. Thnks! drive.google.com/file/d/1bIhcizg8C...
I solved it with ChatGPT. Replace the beginning code to:
var sheetId = 'YOUR_SPREADSHEET_ID'; // Replace 'YOUR_SPREADSHEET_ID' with the actual ID of your Google Sheet
var sheetName = 'Sheet1'; // Replace 'Sheet1' with the name of your sheet if it's different
function doPost(e) {
var lock = LockService.getScriptLock();
lock.tryLock(10000);
try {
var doc = SpreadsheetApp.openById(sheetId); // Open the spreadsheet by ID
var sheet = doc.getSheetByName(sheetName); THE REST OF THE CODE IS THE SAME
So the difference here is that you're putting the exact Google Sheet's ID
Hi Omer. I get error TypeError: Cannot read property 'getId' of null
Please tell me what is causing this error. Thnks!
drive.google.com/file/d/1bIhcizg8C...
I solved it with ChatGPT. Replace the beginning code to:
var sheetId = 'YOUR_SPREADSHEET_ID'; // Replace 'YOUR_SPREADSHEET_ID' with the actual ID of your Google Sheet
var sheetName = 'Sheet1'; // Replace 'Sheet1' with the name of your sheet if it's different
function doPost(e) {
var lock = LockService.getScriptLock();
lock.tryLock(10000);
try {
var doc = SpreadsheetApp.openById(sheetId); // Open the spreadsheet by ID
var sheet = doc.getSheetByName(sheetName);
THE REST OF THE CODE IS THE SAME
So the difference here is that you're putting the exact Google Sheet's ID
Same! Did you solve it?