Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

174
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda