Create a Storage Container Barcode System with Google Sheets and QR Codes
If you’ve ever wished you could scan a storage container barcode (or QR code) and instantly see what’s inside, this guide is for you. With just Google Sheets and Google Apps Script, you can build a simple, low-cost system that makes organizing your garage, attic, or storage unit effortless.
Step 3: Deploy as a Web App
In Apps Script, click Deploy → New deployment.
Choose Web app.
Set Execute as: Me and Who has access: Anyone with the link.
Copy your Web App URL.
Your URL will look like:
https://script.google.com/macros/s/YOUR_DEPLOYMENT_ID/exec?id=HG001&format=card
Step 4: Generate QR Codes for Each Container
In your sheet, add this formula (assuming IDs are in column A):
=IMAGE(
"https://chart.googleapis.com/chart?cht=qr&chs=250x250&chl=" &
ENCODEURL("https://script.google.com/macros/s/YOUR_DEPLOYMENT_ID/exec?id=" & A2 & "&format=card")
)
This generates a QR code for each row. Print and stick them on your containers. Now, when you scan a QR, you’ll see the contents without opening the box.
The Payoff
No more digging through mislabeled bins or playing holiday decoration roulette. With this QR code storage container system, your garage, attic, or storage room becomes fully searchable with just your phone.
It’s flexible, free, and future-proof—you can expand it to hundreds of containers without changing a thing.
Reminder: Replace YOUR_SPREADSHEET_ID_HERE and YOUR_DEPLOYMENT_ID with your own values before publishing or printing QR codes.
/**
* Storage container barcode system powered by Google Sheets
*/
const SHEET_ID = 'YOUR_SPREADSHEET_ID_HERE';
const TAB_NAME = 'Sheet1';
const ID_COL = 'ID';
function doGet(e) {
const ss = SpreadsheetApp.openById(SHEET_ID);
const sh = ss.getSheetByName(TAB_NAME);
const values = sh.getDataRange().getValues();
if (values.length < 2) return respond({ error: 'No data' }, e);
const headers = values[0].map(String);
const data = values.slice(1);
const idIdx = headers.findIndex(h => String(h).trim().toLowerCase() === ID_COL.toLowerCase());
if (idIdx === -1) return respond({ error: `Header '${ID_COL}' not found` }, e);
let row = null;
if (e.parameter.id != null) {
const wanted = String(e.parameter.id).trim();
row = data.find(r => String(r[idIdx]).trim() === wanted);
}
if (!row) return respond({ error: 'Not found' }, e);
const norm = s => String(s).trim().toLowerCase();
const record = {};
headers.forEach((h, i) => (record[norm(h)] = row[i]));
const fmt = String(e.parameter.format || '').toLowerCase();
if (fmt === 'card') {
return HtmlService.createHtmlOutput(`
<meta name="viewport" content="width=device-width, initial-scale=1">
<div style="font-family:sans-serif;max-width:560px;margin:24px auto;padding:20px;border:1px solid #e5e7eb;border-radius:14px;">
<h2>Storage Container #${record.id}</h2>
<p><strong>Name:</strong> ${record.name ?? ''}</p>
<p><strong>Description:</strong> ${record.description ?? ''}</p>
<p><strong>Season:</strong> ${record.season ?? ''}</p>
</div>
`);
}
return ContentService.createTextOutput(JSON.stringify(record))
.setMimeType(ContentService.MimeType.JSON);
}
function respond(payload) {
return ContentService.createTextOutput(JSON.stringify(payload))
.setMimeType(ContentService.MimeType.JSON);
}
Step 3: Deploy as a Web App
In Apps Script, click Deploy → New deployment.
Choose Web app.
Set Execute as: Me and Who has access: Anyone with the link.
Copy your Web App URL.
Your URL will look like:
https://script.google.com/macros/s/YOUR_DEPLOYMENT_ID/exec?id=HG001&format=card
Step 4: Generate QR Codes for Each Container
In your sheet, add this formula (assuming IDs are in column A):
=IMAGE(
"https://chart.googleapis.com/chart?cht=qr&chs=250x250&chl=" &
ENCODEURL("https://script.google.com/macros/s/YOUR_DEPLOYMENT_ID/exec?id=" & A2 & "&format=card")
)
This generates a QR code for each row. Print and stick them on your containers. Now, when you scan a QR, you’ll see the contents without opening the box.
The Payoff
No more digging through mislabeled bins or playing holiday decoration roulette. With this QR code storage container system, your garage, attic, or storage room becomes fully searchable with just your phone.
It’s flexible, free, and future-proof—you can expand it to hundreds of containers without changing a thing.
Reminder: Replace YOUR_SPREADSHEET_ID_HERE and YOUR_DEPLOYMENT_ID with your own values before publishing or printing QR codes.