Well, it says the problem is with getRange on line 33
My guess is that 'A1:1' is not an appropriate range.
Try one that is.
You are using this tutorial https://www.labnol.org/send-sms-google-sheets-200402 or are you using a different model?
You have to be very careful following directions using the above tutorial. The tutorial will build the app it describes.
yes use that tutorial,i do the same code he does, but i front this error
You do not show an image of your spreadsheet or the first 15 lines of your script. I recall a similar issue and it was solved by meticulously reproducing the example.
Your first 15 lines should look like this:
const SHEET_URL = "https://docs.google.com/spreadsheets/d/xxxxxxxxxxxxxxxxxxxxxxxx/edit#gid=0";
const SHEET_NAME = "SMS";
const doGet = () => {
const sheet = SpreadsheetApp.openByUrl(SHEET_URL).getSheetByName(
SHEET_NAME
);
const [header, ...data] = sheet.getDataRange().getDisplayValues();
const PHONE = header.indexOf('Phone');
const TEXT = header.indexOf('Text');
const STATUS = header.indexOf('Status');
where the xxxxxxxx's represent your Google Sheet identification.
the same code that I use
Maybe. There are some subtle things the developer needs to do w.r.t. the Google Sheets.
I cannot give you advice unless you share some screens.
A1:1 is an appropriate range if you follow the tutorial explicitly and you reproduce Amit's screens.
I can't see what steps you missed unfortunately.
What works for me is:
Did you rename the area circled in green to SMS in the spreadsheet ? Why? Because Amit refers to the sheet_name in the script as "SMS" .
i resolved thank you so much
How did you resolve it?
i replace the simple code('') with double code ("") and rename the sheet SMS
Thanks. Renaming the sheet is what fixed the problem. Now others know too. Good luck with the rest of your Project.
thank you so much
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.