Transfer data from one spreadsheet to anotherone

502 views
Skip to first unread message

Guille

unread,
Oct 18, 2023, 10:19:06 AM10/18/23
to Google Apps Script Community
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/spreadsheets
I 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?

Jim Willeke

unread,
Oct 19, 2023, 6:26:06 AM10/19/23
to Google Apps Script Community
I assume this is running locally?

You probably need to add the scopes to the appsscript.json" manifest file

Daniel Paes

unread,
Oct 19, 2023, 7:03:09 AM10/19/23
to google-apps-sc...@googlegroups.com
i have seen some error like that, try to see if these two spreadsheets its google sheet, if one of them its xlsx this permission can be shown (its a guess because last day i have seen something like that)

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/d10afe3f-a24a-40f5-ae15-2d1d6a0c3cc4n%40googlegroups.com.


--
Reply all
Reply to author
Forward
0 new messages