How to export Google spreadsheet tables to google slides

Skip to first unread message


Oct 2, 2022, 3:52:02 AMOct 2
to Google Apps Script Community
I would like to ask a question.
(*I am Japanese. Please understand that the text may be incorrect because I am using a translation)
I would like to use google apps script to export a colored table created in google spreadsheet to google slides at an arbitrary time.
Since I want to export it in colored form, I cannot use the method of exporting as a graph, so I wanted to know about other means.
I would be happy to use an API or other means that costs as little as possible.
Please let me know.

Translated with (free version)

Edward Ulle

Oct 2, 2022, 10:57:06 AMOct 2
to Google Apps Script Community
Here is an example of how to copy a table from spreadsheet to slide.  You can explore other formatting options from SpreadsheetApp ( and from SlideApp (

function myFunction() {
  try {
    let spread = SpreadsheetApp.openById("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
    let sheet = spread.getSheetByName("Sheet1");
    let range = sheet.getDataRange();
    let values = range.getDisplayValues();
    let bColors = range.getBackgrounds();
    let fColors = range.getFontColors();

    let present = SlidesApp.getActivePresentation();
    let slide = present.getSlides()[0];
    let table = slide.insertTable(values.length,values[0].length);
    values.forEach( (row,i) => {
        row.forEach( (text,j) => {
            let cell = table.getCell(i,j)
  catch(err) {

Reply all
Reply to author
0 new messages