r/GoogleAppsScript • • Oct 10 '25

Unresolved Developing a spreadsheet reader, but need verification?

I'm working on a personal-use app that reads spreadsheets from my Google Drive. I'm early in the development process and new to GoogleAppsScripts. I'm getting a "Requested entity was not found" error when calling "const values = Sheets.Spreadsheets.Values.get(sheetId, "A1:A10");" I've verified the sheetId is correct so it seems it may be something with the authorization that I'm not clear on. On one page (which I've lost track of for the moment) it reads like I have to have the app verified before doing this, but then it says in the same paragraph that you can continue to develop while waiting verification. How can I develop anything though? Can anyone cut through the confusion for me? Thank you!

0 Upvotes

6 comments sorted by

View all comments

Show parent comment

1

u/MattCW1701 Oct 10 '25 edited Oct 10 '25

I eventually found me way there. I wish Google was a lot more straightforward about that but. I'm getting a different error now: "Unexpected error while getting the method or property openById on object SpreadsheetApp."

This is the code: "const sheet = SpreadsheetApp.openById(sheetId);"

1

u/krakow81 Oct 10 '25

Sorry, I just realised that I'd forgotten to get the sheet in the above code line I wrote, edited that now. I don't know if it might be part of the error but you need to get the Spreadsheet file and then the particular sheet within that file, before accessing ranges and values.

You could get the sheet by name, by sheet ID, or by using getSheets()[0] to simply get the first sheet if that's the one you want.

So you might have something like...

const spreadsheet = SpreadsheetApp.openById(sheetId); // get the file
const sheet = spreadsheet.getSheetByName(sheetName); // get the sheet/tab
const values = sheet.getRange("A1:A10").getValues(); // get the values

Where are you getting what you're referring to as sheetId from? Are you manually pulling it from the url of the file you want to work on?

1

u/krakow81 Oct 10 '25

Maybe obvious, but does the Google account running the script definitely have access to the spreadsheet file?