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
Changeapi-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.
Change the rules
- The age ranges.
SECTIONSuses the usual UK ranges: Squirrels to 6, Beavers to 8, Cubs to 10½, Scouts to 14 and Explorers to 18. Changemonthsif 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. Keepexplorerabovescout, because “Explorer Scouts” contains both words. - How far ahead. Change
LOOK_AHEAD_MONTHSto see further ahead, for example12to plan a whole year.