Setup steps:
- Open your Google Sheet → Extensions → Apps Script
- Paste the doGet script, save and deploy as Web App (access: Anyone)
- Copy the Web App URL and paste below
function doGet(e) {
const name = e.parameter.sheet || 'Packages';
const sh = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(name);
if (!sh) return out({error: 'Sheet not found: ' + name});
const rows = sh.getDataRange().getValues();
const hdrs = rows[0];
return out(rows.slice(1).map(r => {
const o = {};
hdrs.forEach((h,i) => o[h] = r[i]);
return o;
}));
}
function out(d) {
return ContentService.createTextOutput(JSON.stringify(d)).setMimeType(ContentService.MimeType.JSON);
}
Sheet tab names must be exactly: Packages, Individual Tests, IVs, Medical Services