Error TypeError: Cannot read properties of undefined (reading 'parameter') doGet

1,671 views
Skip to first unread message

Muhammad Irfan

unread,
Mar 5, 2023, 1:52:12 AM3/5/23
to Google Apps Script Community
Hello,

I need your help,

How to solve this error?
Here is my script

function doGet(e) {
  if (e.parameter.id && e.parameter.status) {
    updateStatus(e.parameter.ide.parameter.status);
    return ContentService.createTextOutput("Success");
  }
  return ContentService.createTextOutput("Invalid Request");
}

function updateStatus(idstatus) {
  var sheet = SpreadsheetApp.openById('1rGzD78y55__o1OF6rXUep5Seg5c5BmT8UtqwSJ6rNeM').getSheetByName('quote');
  var data = sheet.getDataRange().getValues();
  for (var i = 0i < data.lengthi++) {
    if (data[i][0] == id) {
      data[i][2] = status;
      sheet.getRange(i+13).setValue(status);
      break;
    }
  }
}

TypeError: Cannot read properties of undefined (reading 'parameter')

Brett Grear

unread,
Mar 5, 2023, 5:29:20 AM3/5/23
to Google Apps Script Community
What URL are you visiting your webapp by?
Does it have ?id=12344&status=something on the end of it?

Muhammad Irfan

unread,
Mar 5, 2023, 10:00:10 PM3/5/23
to Google Apps Script Community
Thank you for your response. 

It solved. I had to give access the spreadsheet to the user

Reply all
Reply to author
Forward
0 new messages