The Repetition of Reporting
Every Monday morning, thousands of analysts undergo the exact same tedious ritual: they open a Google Sheet containing the latest sales metrics, copy the data, open a Google Slides presentation, and painstakingly paste the numbers into text boxes on ten different slides. They adjust the formatting, fix the alignment, and email the deck to management. This process takes an hour, and it must be repeated every single week.
By leveraging Google Apps Script, you can eliminate this manual labor entirely. You can write a script that reads the fresh data from your Google Sheet, opens a master Google Slides template, duplicates the template, automatically injects the new data into the correct text boxes, and saves a brand new, fully populated presentation in your Google Drive.
Step 1: Create the Slides Template
The secret to this automation is creating a “Template” slide deck that uses placeholder tags.
- Create a new Google Slides presentation. Name it “Weekly Report Template”.
- Design the slide exactly how you want it to look (colors, logos, layout).
- Wherever you want the dynamic data from the spreadsheet to appear, type a placeholder tag using double curly brackets. For example:
{{Total_Sales}}{{Top_Rep}}{{Week_Date}}
- Look at the URL of this Slides presentation in your browser. Copy the long string of letters and numbers in the middle. This is your Template ID.
Step 2: Prepare the Google Sheet
Now, prepare the data source.
- Create a new Google Sheet.
- In Row 1, put your headers (e.g., Date, Total Sales, Top Rep).
- In Row 2, put the actual data you want to inject into the slides.
Step 3: Write the Apps Script
- In the Google Sheet, click on Extensions > Apps Script.
- Delete the default code and paste the following.
function generateSlideDeck() {
// --- CONFIGURATION ---
var TEMPLATE_ID = "PASTE_YOUR_SLIDES_TEMPLATE_ID_HERE";
// ---------------------
// 1. Get the data from the spreadsheet (Assuming data is in Row 2)
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var dateVal = sheet.getRange("A2").getDisplayValue();
var salesVal = sheet.getRange("B2").getDisplayValue();
var repVal = sheet.getRange("C2").getDisplayValue();
// 2. Duplicate the template to create a new, safe copy
var templateFile = DriveApp.getFileById(TEMPLATE_ID);
var newFileName = "Weekly Report - " + dateVal;
var newFile = templateFile.makeCopy(newFileName);
// 3. Open the newly copied presentation
var presentation = SlidesApp.openById(newFile.getId());
// 4. Find and replace the tags with the spreadsheet data
// We use replaceAllText to search the entire presentation globally
presentation.replaceAllText("{{Week_Date}}", dateVal);
presentation.replaceAllText("{{Total_Sales}}", salesVal);
presentation.replaceAllText("{{Top_Rep}}", repVal);
// 5. Save and close the presentation
presentation.saveAndClose();
Logger.log("Success! New presentation created: " + newFile.getUrl());
}
Understanding the Code
getDisplayValue()is crucial. It pulls the text exactly as it appears in the spreadsheet (e.g., “$1,500.00”). If you usedgetValue(), it would pull the raw, unformatted integer (e.g., “1500”), ruining the formatting on your slide.- The script uses
makeCopy()so you never accidentally overwrite your master template. replaceAllText()automatically searches every text box on every slide in the presentation. You don’t have to worry about specifying which slide the data goes on.
Paste your Template ID into the configuration variable and click Save.
Step 4: Run the Script
- Click the Run button at the top of the editor.
- Google will demand authorization to access your Drive and Slides. Grant the permissions.
- Go to your Google Drive homepage.
You will see a brand new Google Slides presentation named “Weekly Report – [Today’s Date]”. Open it. You will see that the {{Total_Sales}} tags have been perfectly replaced with the dollar amounts from your spreadsheet, inheriting whatever font, size, and color you originally applied to the placeholder tags in the template.
Conclusion
By connecting Google Sheets and Google Slides via Apps Script, you bridge the gap between data analysis and data presentation. This automated workflow turns hours of weekly copy-pasting into a single click, ensuring your executive reporting is both perfectly formatted and mathematically flawless.