There are several Google Sheets that record different metrics for my organisation. In most of these I have added charts. Now I have linked those charts to Google Slides, so that it acts as a high-level management report. Some slides have only one chart, but some may have three or four. I don't know if that's even relevant.
Every day, after various updates have been run in the Sheets, I open the slides and click Tools > Linked objects > Update all. Except that sometimes I forget, or I'm away, or whatever.
So, can app script automate this process? I know that you can set triggers to run things at a certain time of day, but I have no idea how to write the script. And can it be done without me (the owner) being logged in? Presumably the code would have to list the ID of the slides.
In case it helps, I have created a Goggle Sheets and Google Slides file (with fake data) and shared them publicly.
https://docs.google.com/spreadsheets/d/1gpJ5M8gAIhTXf4YaqEk3uM0Ie8jyCQ5LJbe3qgcX_o8/edit?usp=sharing
https://docs.google.com/presentation/d/1-BAEl4DJOz4X8l5XBRsR-tKf_sNPWnTv5ujdvoghrd8/edit?usp=sharing
Thanks
You want to automate the process of updating charts in Google Slides from the linked charts in Google Sheets. You have a single Slides file that contains several linked charts from multiple Google Sheets.
Google slides auto update links /tables linked from google sheet provides the key to updating charts in linked sheets. In that question, the script was bound to the Google Slides file.
In this answer,
function refreshCharts(){
var slideId = "<<Insert Slides ID>>"
var pres = SlidesApp.openById(slideId)
var gotSlides = pres.getSlides();
for (var i = 0; i < gotSlides.length; i++) {
var slide = gotSlides[i];
var sheetsCharts = slide.getSheetsCharts();
for (var k = 0; k < sheetsCharts.length; k++) {
var shChart = sheetsCharts[k];
shChart.refresh();
}
}
}