charts from one google spreadsheet to another dynamically - google-apps-script

Google spreadsheet A with "sheet 1" - Master spreadsheet
Google spreadsheet B with "sheet 1"
There are charts in sheet B with source data in it. I want to import the chart to master spreadsheet B in such a way that, when the chart changes in sheet B, it should dynamically change in master sheet A too.
After a lot of research, I was able to find below:
Importrange - imports the data only, and not charts
copying the chart itself and pasting it to master sheet A, but it doesn't get changed when the chart is changing dynamically in sheet B.
publishing the chart and inserting the URL as an image - this doesn't work if the master sheet A is google spreadsheet, but works for google docs, slides, etc. (correct me if I am wrong, as I tried and threw me an error)
For ease of explanation, I have given only two spreadsheets as an example. In the real case, I have one mastersheet, and 6 separate spreadsheets.
Any alternative suggested, or help is highly appreciated. Thanks

Don't know your task but I found the answer to your question by using IMPORTAGE for data, then show the chart and hide the list where the data are shown

Related

In Google Sheets, is there a way to see when a cell was populated?

I've got a spreadsheet that has data added to it sporadically. I'd like to know when data was entered into certain cells.
Is there a way to find the date when a cell was populated?
Note: there are several thousand populated cells, so just looking at past iterations of the entire sheet is not going to work.
Right click the cell and then select "Show edit history"
Reference
View the activity on your Google Docs, Sheets & Slides
Related
GoogleSheets - Is there a way to extract user info from "show edit history" to a cell?
Is cell edit history accessible programmatically in Google Apps Script?

Recording any copies made of a google sheet

I would like to create a Google sheet that records any copies that have been made of another Google Sheet even when the user creates a copy by putting 'copy' into the URL (https://docs.google.com/spreadsheets/d/"spreadsheet-ID"/copy).
I have found a solution on the post: Track number of copies made from a google spreadsheet but this doesn't record copies made when changing the URL as the above example.
I would like to know the whole URL of the sheet preferably but just the Spreadhseet ID would still be enough for me.
Has anyone got any ideas how I can record all this data onto a spreadsheet please?
Basically you won't have access to see who is copying your sheet if you use the built-in Make Copy.
What you could do is integrate part of the question you have provided, while disabling the built-in sharing method. So the only way to copy your sheet could be through a custom function you can control and register every time it executes.

Create static overview sheet based on dynamic and changing source sheet

Short description of what I am looking for:
A way to automatically import data from a dynamic Google Sheets document (using the Google Analytics add on) in another static Google Sheet, where the data will be automatically filled out in the right spot, but also stay there whenever the dynamic sheet changes.
A bit of context:
I am using Google's Analytics add on in Google Sheets (DOC1) to run reports about e.g. the number of users visiting my website every day. Due to the high amount of data, I can only run reports for about a month without sampling taking place.
For 2020 I would like to create an overview sheet (DOC2) to share with other people which gives an overview of the whole year. In other words, the cells of January in DOC2 should be filled when the data for January are rendered in DOC1. However, when data from February are being rendered in DOC1, the data from January should stay in DOC2.
I know it would be possible by copy and pasting the run reports to a non-dynamic sheet, but as I will need this for multiple parameters, this is not really a workable solution.
What I've tried
Multiple combinations of lookup and importrange functions, but the true difficulty stays in keeping the data once they are removed in the dynamic document. I have not found a solution to this problem yet...
If you are familiar with Apps Script, your request can be achieved with the method setValues()
Sample:
function myFunction(){
var origin=SpreadsheetApp.openById("ID of origin Spreadsheet").getSheetByName("Name of the Sheet");
var destination=SpreadsheetApp.openById("ID of destination Spreadsheet").getSheetByName("Name of the Sheet");
var range=origin.getDataRange();
var values=range.getValues();
var A1notation=range.getA1Notation();
destination.getRange(A1notation).setValues(values);
}
Fill into the code the IDs of your origin and destination spreadsheets, as well as the correct names of the origin and destination sheets.
Links to other useful methods:
SpreadsheetApp
getDataRange()
getA1Notation
getValues

Switch from one spreadsheet to another in the same tab in Google Sheets with a script

I've been trying to build a script which I can use to switch from a given sheet in one spreadsheet, to a given sheet in another spreadsheet, in the same browser tab, where both spreadsheets are on the same google drive and in the same folder.
The purpose for doing this is I have more data than I can fit on a single google sheets spreadsheet (More than 200 individual sheets are needed) and I'd like to be able to navigate between them as seamlessly as possible.
I could have sworn I had a simple script like this working at some point, but I'm not sure. The script does appear to run, but it there is no result, it doesn't actually open the other sheet.
I've tried using both .openByID and .openByUrl, and both appear to give me the same result.
I set up two new spreadsheets, A and B, each with their own script, A pointing to B, and B pointing to A. The destination sheet within the spreadsheet has been named MainA and MainB.
//This is your "Go Home" Button
//URL of A: https://docs.google.com/spreadsheets /d/1LzsxZ3cCcOltELM_0T4VwipqYv5BbBDj9ugAZcciNHQ/edit#gid=0
//URL of B: https://docs.google.com/spreadsheets/d/1wrjr9VSsHb63RKz87JQbe20mCo1CteKHtsAiUGrb6O0/edit#gid=0
//ID of A: 1LzsxZ3cCcOltELM_0T4VwipqYv5BbBDj9ugAZcciNHQ
//ID of B: 1wrjr9VSsHb63RKz87JQbe20mCo1CteKHtsAiUGrb6O0
function goto_a() {
var ss = SpreadsheetApp.openById("1LzsxZ3cCcOltELM_0T4VwipqYv5BbBDj9ugAZcciNHQ")
ss.setActiveSheet(ss.getSheetByName("MainA"));
}
Obv the script for A is similar to this one, but with differently named function, destination sheet, and spreadsheet ID
In both cases, I'm using a button (drawing image) with the relevant script attached. If need be, I can share these spreadsheets so that the script can be tested.
Any advice would be great, thanks in advance.
As written in the official documentation ,
//Note that the spreadsheet is NOT physically opened on the client side.
// It is opened on the server only (for modification by the script).
You can alternatively provide a link using Browser.msgBox() for the user to click.
Related Question

merge two google forms data into the one spreadsheet

I want to create application which takes two different google forms data into the one spreadsheet and having two different sheets there on a single spreadsheet with the help of google apps script.
I've searched over a lot but hadn't find any satisfactory solution. Can anyone tell me that is that possible to acheive with google-apps-scripts?
Sorry, I don't have any piece of code this time.
It is impossible to insert data of two Google Forms directly to a single spreadsheet using GAS without involving another two spreadsheets, because now the Forms are able to deploy data only to own spreadsheet and GAS has no any service to access to the Forms.
There is a workaround which merges the Forms spreadsheets to a single spreadsheet using the ImportRange function (see bellow paragraph) but seems it is not suitable for you.
The spreadsheets have the ImportRange function which permits to import a source spreadsheet range to a destination spreadsheet, for instance, there is a task to import spreadsheet_1 columns A, B, C of Sheet1 and spreadsheet_2 columns B, C of the Sheet2 to spreadsheet_0 columns F, G, H, I and J. To achieve it is necessary to place to the spreadsheet_0 cell F1 the =ImportRange("spreadsheet_1_key", "Sheet1!A:C") formula and the cell I1 should contain the =ImportRange("spreadsheet_2_key", "Sheet2!B:C") formula.
For anyone who ends up at this question, looking for some general knowledge, you can change the form destination. In the form editor, choose RESPONSES, CHANGE RESPONSE DESTINATION. The form responses can be sent to another spreadsheet. I'm not sure if this is a capability that didn't exist when this question was first asked, but for anyone doing a general search, you might end up here.