Skip to main content
Each section has an age range. This recipe finds the young people who are near the top of their range, and the date they reach it. Section leaders use it to plan who moves on each term, and how many places open up for the waiting list. It fills a Moving on tab in a Google Sheet. It takes about five minutes.

1. Add the script

In your Google Sheet, choose Extensions → Apps Script. Delete what is there, paste the script below 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: the sandbox key to try it, or your own key.

3. Run it

Choose movingOn in the toolbar and press Run. Open the Moving on tab. The young person who reaches the top age first is at the top. The Already in next section column says Yes when the young person is in two sections. Usually that means they have started to move on already.

4. Switch to your group

Change api-demo.scoutworks.app to api.scoutworks.app, and replace the sandbox key with your own. Your key needs members:read and members.contacts:read. The second scope adds dates of birth. Without it, the script stops with an error that names the missing scope.
Dates of birth are personal data. Keep the sheet private to your leaders. Do not share it with a link that anyone can open.

Change the rules

  • The age ranges. SECTIONS uses the usual UK ranges: Squirrels to 6, Beavers to 8, Cubs to 10½, Scouts to 14 and Explorers to 18. Change months if your group moves young people on at other ages.
  • Section names. The script finds a section by a word in its name, so “Red Beavers” and “1st Anytown Beavers” both count as Beavers. If a name has none of the words, add a line to SECTIONS. Keep explorer above scout, because “Explorer Scouts” contains both words.
  • How far ahead. Change LOOK_AHEAD_MONTHS to see further ahead, for example 12 to plan a whole year.