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

243
Vistas
How can I replace text in Google Presentations with text from Google Sheets?

I'm really new to programming in Google Apps Script and I'm trying to replace some words in all my slides with some text from a spreadsheet. I was following an internet tutorial for a similar task, but for replacing data in a Google Docs. I thought it would be the same, but it isn't and I'm kinda lost now. I need to 'translate' this piece of code from Docs to replace text in Slides.

var doc = DocumentApp.openById(copy.getId()); 
var body = doc.getBody();
body.replaceText('name', name);
body.replaceText('adress', adress);
body.replaceText('date', date);

I know I read the slide by this:

var presentation = Slides.Presentations.get(copy.getId());

But I don't know how to do the same task from before, but with my slides. Can someone help?

Edit: I tried what @Kos suggested. Since I have to replace about 20 words, I tried to implement a for loop, but I still don't get my words replaced in the slide.

var dict = {'{{word1}}':word1,'{{word2}}':word2};
for(let i=0; i< dict.length; i++){
    const resource = {
      requests: [{
        replaceAllText: {
          replaceText: dict[dict[i]],
          containsText: { matchCase: true, text: dict[i] }
        }
      }]
    };
    Slides.Presentations.batchUpdate(resource, presentation.getId());
  }

Should I try a different approach for replacing these words?

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