2

I have several Google Sheets tables inside a Googles Slides presentation that I would like to keep automatically updated.

Is there a of triggering the new "Update All" feature in Scripts? Or is there some other feature that would do it?

Note - I know there is a way of automatically updating Sheets Charts in a Slides presentation, but I specifically need a way to automatically update Sheets Tables. Recently at least this wasn't possible but I am hoping things have changed in light of the new "Update All" feature.

  • FYI - there's a [Zap](https://zapier.com/apps/google-sheets/integrations/google-slides/13919/refresh-charts-on-a-google-slides-presentation-when-rows-are-updated-on-google-sheets) that does this :) – Sourabh Choraria Dec 19 '19 at 16:59
  • There is a feature request for it: https://issuetracker.google.com/64027131. Give it a start to increase visibility. – ziganotschka Dec 24 '19 at 13:44

1 Answers1

0

Try this -

function myFunction() {
  var presentation = SlidesApp.getActivePresentation();
  var slides = presentation.getSlides();
  for (var i = 0; i < slides.length; i++) {
    var slide = slides[i];
    var charts = slide.getSheetsCharts();
    for (var j = 0; j < charts.length; j++) {
      var chart = charts[j];
      chart.refresh();
    }
  }
}

I'm using an onOpen trigger but you're free to replace it with a normal function or another trigger ex: onEdit(e) and it would virtually update every single chart in all the slides.

Hope this helps.

Sourabh Choraria
  • 2,255
  • 25
  • 64