How to get the speadsheet id of an embedded table in google slide with Google Apps Script?

41 Views Asked by At

I wrote a small Google Apps Script Addon for Google Presentation which looks for embedded Google Charts from a spreadsheet and duplicates this spreadsheet. It gets all SheetCharts which have a Method to get the ID of the spreadsheet.

  var newSlide = SlidesApp.getActivePresentation().getSelection().getCurrentPage().asSlide();
var allCharts = newSlide.getSheetsCharts();
for(var i = 0; i < allCharts.length; i++){
   chartInfos.push({
     chartSheet:allCharts[i],
     sourceSheetId: allCharts[i].getSpreadsheetId()
   })
  }

This works pretty well, however now I want to do the exact same thing with embedded tables from a spreadsheet. On the Slides class there is a getTables which gives you an array of all Tables in that slide, however there is no method to get the spreadsheet id of that table..

So my question is how to get the underlying spreadsheet id of a table which was added from a spreadsheet to a slide?

0

There are 0 best solutions below