Image variables

Hi,

I want help with the Code which i am using to pass variables from google sheet to a google slide file.

i have a code that is able to replace text variables, but some of the columns have images from my Appsheet and i want to replace them as a variable too. i am pasting below text, please help me to replace image cells also.:-

function fillTemplate(){

  const templatepresentation_ID = "1bE8WkxJ6r4-_WkqsROUpJvndhfdds6CG315vyKZRtYc";
  const ss = SpreadsheetApp.getActiveSpreadsheet();
  const sheet = ss.getSheetByName("Template");
  const slidename = sheet.getRange(1,2).getValue();

  DriveApp.getFileById(templatepresentation_ID).makeCopy().setName(slidename);
 
  const presentation_ID = DriveApp.getFilesByName(slidename).next().getId();

  var presentation = SlidesApp.openById(presentation_ID);
  var values = SpreadsheetApp.getActive().getDataRange().getValues();

 


  values.forEach(function(row){
  var templateVirable= row[0];
  var templateValue= row[1];

  presentation.replaceAllText(templateVirable,templateValue);

  });

}

 

0 0 26
0 REPLIES 0
Top Labels in this Space