Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

175
Views
How to import data from Google sheets to Slides

I am trying to create a button in google sheets that run a script every time it is triggered. The script should first create a new copy of the template and then using that google sheet replace all placeholder text in that presentation with data from sheets. I am not sure why the code is not working as of now.

// The following creates the UI button in sheets (This works)
function onOpen() {
  let ui = SpreadsheetApp.getUi();
  ui.createMenu('Create Report')
  .addItem('Create Report', 'executeAll')
  .addToUi();
}

function executeAll (){
  var reportTemplate = DriveApp.getFileById('Presentation ID goes Here');
  var copiedTemplate = reportTemplate.makeCopy('New Report', DriveApp.getFolderById("Folder ID Goes here"));
  var skeleton = SlidesApp.openById(copiedTemplate.getId());
  var slides = skeleton.getSlides();
  return slide1();


  function slide1 (){
    var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('App Script Input Sheet');
    var data = sheet.getRange('E1:F26').getValues;
    var slide1 = slides[0];
    var newslide1 = slide1.duplicate();
    var shapes = (newslide1.getShapes());
      shapes.forEach(function(shape){
        shape.getText().replaceAllText('{{Date}}',data[2]);
        shape.getText().replaceAllText('{{Title}}',data[3]);
        shape.getText().replaceAllText('{{Value 1}}',data[4]);
        shape.getText().replaceAllText('{{Value 2}}',data[5]);
        //there are more to be replaced. will add once code works. 
       

      });
  }
}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!