I've been working on a script and I want it to get data to the active spreadsheet from a different spreadsheet when interacting with a menu in the active spreadsheet. When trying to do so with only the function that does that it executes correctly. But when I try to do it when I have many other functions doing different things in the same script it appears the following error:
Exception: You do not have permission to call SpreadsheetApp.openById. Required permissions: https://www.googleapis.com/auth/spreadsheetsI realized that when doing it with only the function that calls the SpreadsheetApp.openById and not many other functions it requests the permission "See, edit and manage all your Spreadsheets". However, when I try to execute it with many other functions this permission changes to "View and manage spreadsheets where this application is installed.".
I have the
https://www.googleapis.com/auth/spreadsheets permission added in the Google Cloud Project that corresponds to the script.
How can I solve that?