By Raj
Estimated reading time: 8 minutes
Generate Google Slides from Sheets with Apps Script
Building the same deck repeatedly from spreadsheet data—e.g. one slide per client or per month—wastes time. Generating Google Slides from Sheets with Apps Script automates it: read rows, copy a template presentation or create slides programmatically, replace placeholders or fill shapes with data, and save to Drive or share. You get consistent decks without manual copy-paste. The limits are execution time and Slides/Drive API quotas, so you batch work (e.g. 5–10 decks per run) and use triggers to process a queue. This guide covers architecture, implementation with SlidesApp, and scaling.
Common mistakes
- Creating one full deck per row in a long loop—hitting execution time.
- No template; building every slide from scratch in code (slow and hard to maintain).
- Not batching; processing hundreds of rows in one run.
- Assuming slide layout placeholders have fixed IDs; they can vary by template.
- No status column or cursor so the same rows are processed again.
Architecture
Flow: Sheet (data source) → script reads rows → for each row (or batch), copy template deck or create presentation via SlidesApp, replace text in placeholders or shapes, save. Use a template Slide deck with named placeholders or known shape indices so the script only fills data. For “one slide per row” reports, either append slides to one deck or create one deck per row; the latter scales better with batch size limits. Link to execution time limit for chunking when row count is large.
Implementation
Template and replace
Copy the template with DriveApp.getFileById(templateId).makeCopy(), open with SlidesApp.openById(copyId), get slides and shapes, then shape.getText().setText(value) or replace placeholder text. Use a consistent template layout so you can index slides and shapes. Process up to N rows per run (e.g. 5–10) so the run stays under 5 minutes.
function generateSlidesFromSheet() {
const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheetByName("Data");
const lastRow = sheet.getLastRow();
if (lastRow < 2) return;
const numRows = lastRow - 1;
const data = sheet.getRange(2, 1, 2 + numRows - 1, 5).getValues();
const templateId = PropertiesService.getScriptProperties().getProperty("SLIDES_TEMPLATE_ID");
const BATCH = 5;
for (var i = 0; i < Math.min(BATCH, data.length); i++) {
var copy = DriveApp.getFileById(templateId).makeCopy();
var pres = SlidesApp.openById(copy.getId());
var slide = pres.getSlides()[0];
var shapes = slide.getShapes();
if (shapes.length > 0) shapes[0].getText().setText(data[i][0]);
pres.saveAndClose();
}
}Triggers
Time-driven trigger for batch generation; or on Form Submit if each submission should create one deck. Store template ID in Script Properties. For custom UIs that trigger generation, Apps Script web apps can expose a button or form.
Example: A team generated monthly client reports as Slides (one deck per client, same layout). We automated: read “Pending” rows from Sheet, copy template, fill 3 slides per deck from row data, save to a folder; batch of 5 decks per run, daily trigger. Manual deck creation dropped from ~2 hours/month to zero.
Batching deck generation (5–10 per run) typically keeps runtime under 4 minutes and avoids Slides/Drive quota spikes.
Need Slides-from-Sheets automation for your template and volume? We build batch generation within quota.
Discuss your setupScalability and quotas
Execution time and Slides/Drive create limits apply. Batch (5–10 decks per run), use a status column, and schedule triggers. For very high volume, use a cursor and continuation trigger. API integrations can push links to generated decks to another system.
Enterprise scaling
One trigger per job; log run count and errors. Document template ownership. Separate workbooks or scripts per team if needed for quota isolation.
FAQ
How much does it cost to generate Slides from Sheets?
Sheets and Apps Script are in Workspace. You pay for script development or template design. No per-presentation fee. Slides created count against Drive storage.
What are the limits for generating Slides from Sheets?
6-minute execution per run; Slides API and Drive create limits apply. For many decks, generate in batches (e.g. 5–10 per run) and use a time-driven trigger or queue.
Is presentation data secure?
Data stays in your Workspace. Slides are created in your Drive. Use sharing and Script Properties. No external service unless you add one.
When to use a dedicated presentation tool instead?
Use a dedicated tool for real-time collaboration on one deck or complex animation. Use Sheets → Slides when you have tabular data and want automated deck generation.
About the author
Raj is an Apps Script and Google Workspace automation specialist. He builds Slides-from-Sheets and report automation for teams and SMEs.
More about Raj