Open another Google Sheets in my Google Sheets App Script

79 views
Skip to first unread message

Guillaume VILLAIN

unread,
Nov 25, 2020, 4:34:21 AM11/25/20
to Google Apps Script Community
(I'am french, my english is average)

Hello All

I have a Google Sheets file with functions.
In this sheets, I need to import data from another Google Sheet file (multiple tabs). 

I can't find a solution on the web. Is it possible ?

Thanks

gilbert_RGI

unread,
Nov 25, 2020, 5:38:15 AM11/25/20
to Google Apps Script Community
Hello
 The "QUERY" and "IMPORTERANGE" functions allow this kind of import learn about these two nested functions.
 Greetings 
 Gilbert  

Laurie Nason

unread,
Nov 25, 2020, 5:46:42 AM11/25/20
to google-apps-sc...@googlegroups.com
Hi Guillaume,
I am english - my french is pretty bad!
As gilbert mentioned these are the two main functions that you can use for a non-editable copy of the information.

It depends on what information you want to get from the other google sheet file.
If you want to pull the data across from one to the other and keep the two sheets synchronised, then you can use the "importrange" function . This will give you only a one way synchronization from the original - if someone changes information there, the data will magically change in the second sheet.

If you want to make a snapshot copy of the data from apps script, you can do that as well. There are multiple ways you can accomplish this. You could push the data from the original sheet to the copy, or pull the data from a script on the second sheet using a relatively simple script. If that's what you need to do, then reply back and we can start from there!

Laurie





--
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/5b700fb1-5e14-41f6-b608-2c5609869b0ao%40googlegroups.com.


--

Laurie Nason 

The KAUST School – Operational Analyst

Information Technology Support
Deep in the Bowels of the School
Landline: +966-12-808-6853

guillaum...@ext.leroymerlin.fr

unread,
Nov 26, 2020, 3:41:56 AM11/26/20
to Google Apps Script Community
Hello Gilbert and Laurie

I can use IMPORTRANGE directly in my google sheets but I was looking to open a sheet in the code.

I found 2 functions and it's ok now ;-) : 
-  SpreadsheetApp.openById(ID)
- SpreadsheetApp.openByUrl(url)

Thanks for your time :-)
Reply all
Reply to author
Forward
0 new messages