Skip to main content
This recipe adds a Groups tab to a Google Sheet: one row per group that shares data with your district, with its members, waiting list and 12-month growth. A timer refreshes it every morning. It works the same for a county, region or the national team. You need a district or area key with nodes:structure:read and nodes:metrics:read. A district admin creates one in the district’s Settings → Integrations → API keys. See Keys for districts and above.

1. Add the script

In your Google Sheet, choose Extensions → Apps Script, delete what is there, paste this and choose Save.
Code.gs

2. Add your key

In the script editor, choose Project Settings (the cog), then Script Properties → Add script property. Property: SCOUTWORKS_API_KEY. Value: your district or area key. Choose Save script properties.

3. Run it, then refresh it every morning

Choose importDistrictTotals and press Run. Then choose Triggers (the clock) → Add Trigger: function importDistrictTotals, Time-driven, Day timer, 6am to 7am. The totals are built overnight, so a morning refresh always reads last night’s. A group that stops sharing with you drops off the sheet at once, and out of your district’s own total within 24 hours.