0

I'm making a Google Spreadsheet with some information that I want to import in my Google Slide project. That works fine.

I want to make sure that I can update all input in the Google Slides document with a function.

So far I found out how to make a menu item that updates every chart in Slides, imported from the Sheet document.

I have a really hard time figuring out how to update Shapes? (Shapes is elements such as text boxes) I'm using some values inside the Shape elements in Google Slides, which is imported from the spreadsheet.

So far my function which works for updating charts is:

function onOpen() {
  var ui = SlidesApp.getUi();
  ui.createMenu('s360 functions')
  .addItem('Opdater alle elementer', 'batchUpdate')
  .addToUi();
}

function batchUpdate(){

  var gotSlides = SlidesApp.getActivePresentation().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();
    }
  }
}

If you see the list here: https://developers.google.com/apps-script/reference/slides/notes-master#getShapes()

It should work when i'm using the getShapes() function instead of the getSheetsCharts function, but when I'm doing that I'm getting a warning about the refresh function in the object Shape was not found.

How do I solve this?

Kos
  • 4,890
  • 9
  • 38
  • 42

0 Answers0