Auto-refresh charts in Slides from a Sheet
Update embedded Sheet charts in a Northwind deck on a schedule — never present stale data.
Published Jul 6, 2025
Northwind keeps a standing deck for client updates with charts pulled from a performance Sheet. Google Slides does not refresh those embedded charts on its own — when the Sheet data moves, each chart in the deck still shows whatever it showed when it was last linked. Someone has to open the deck, click every chart, and choose Update. Skip that and the meeting runs on last month’s numbers.
This script does the clicking. It opens the deck, finds every linked Sheets chart on every slide, and refreshes each one against its source. Run it on a schedule and the deck is always current the moment you open it.
What you’ll need
- A Google Slides deck with one or more charts inserted from a Sheet using Insert → Chart → From Sheets with the Link to spreadsheet option ticked.
- The deck’s file ID, and edit access to the deck for the account running the script.
- The source Sheet shared with that same account, so the refresh can read the current data.
The script
// The deck whose linked charts should be refreshed.
const DECK_ID = '1abcDeckId';
/**
* Opens the deck and refreshes every linked Sheets chart on every
* slide, so each chart matches its source spreadsheet.
*/
function refreshLinkedCharts() {
const deck = SlidesApp.openById(DECK_ID);
const slides = deck.getSlides();
// Guard: an empty deck has nothing to refresh.
if (!slides.length) {
Logger.log('Deck has no slides — nothing to refresh.');
return;
}
let refreshed = 0;
// Walk every slide in the deck.
for (const slide of slides) {
// Each slide may hold several linked Sheets charts.
for (const sheetsChart of slide.getSheetsCharts()) {
// Pull the latest data from the source spreadsheet.
sheetsChart.refresh();
refreshed++;
}
}
Logger.log(`Refreshed ${refreshed} linked chart(s).`);
}
How it works
refreshLinkedChartsopens the deck by ID and reads every slide withgetSlides().- If the deck has no slides it logs a message and stops — no wasted work.
- It loops the slides one by one.
- For each slide it calls
getSheetsCharts(), which returns only the charts that were inserted from a Sheet and linked — ordinary images and native shapes are ignored. - It calls
refresh()on each linked chart, which re-fetches the data from the source spreadsheet and redraws the chart in the deck. - It counts the charts it touched and logs the total, so a scheduled run leaves a trace you can check.
Example run
The source Sheet has a quarterly revenue table that gets updated each morning. The deck has three slides, each with one linked chart.
Before the run, the charts show Monday’s figures. After refreshLinkedCharts,
the execution log reads:
Refreshed 3 linked chart(s).
Open the deck and every chart now matches Tuesday’s data — no clicking Update on each one.
Trigger it
Run this on a daily schedule so the deck is fresh before anyone opens it:
- In the Apps Script editor open Triggers (the clock icon).
- Add a trigger for
refreshLinkedCharts, Time-driven, Day timer, set to run between 6am and 7am. - Approve the authorisation prompt. The deck’s charts now refresh every morning ahead of the working day.
Watch out for
- Only charts inserted from a Sheet with linking enabled are refreshed. A
chart pasted as a static image, or one not linked, is invisible to
getSheetsCharts(). - The refresh redraws each chart but keeps its existing size and position. If the underlying chart type or axes change in the Sheet, re-insert the chart rather than relying on a refresh.
- The script needs access to both the deck and the source Sheet. If the Sheet is later restricted, the refresh fails silently for that chart.
- A deck with many charts can be slow to refresh, since each chart is a separate fetch. Keep an eye on the six-minute execution limit for very large decks.
- A run only updates the saved deck. Anyone with the deck already open must reload it to see the new charts.
Related
Extract all deck text into a sheet
Pull text out of every slide for review, translation, or copy-editing.
Updated Jan 4, 2026
Generate sales-enablement decks per segment
Tailor Northwind's messaging slides by audience segment — fintech, healthcare, retail.
Updated Dec 28, 2025
Insert chapter divider slides from an outline
Add section-break slides between chapters in a Northwind deck.
Updated Dec 21, 2025
Build a deck accessibility checker
Flag missing alt text, low contrast, and tiny fonts across a Northwind deck.
Updated Dec 14, 2025
Drive menu and price-list signage from a Sheet
Generate display slides for a Northwind venue — menus or price lists driven by a Sheet.
Updated Dec 7, 2025