- For: Scout and Cub leaders
- You get: a full-screen scoreboard that updates every minute, and a phone shortcut that adds points to a patrol
- Time: about twenty minutes
- Scopes:
recognition:readandmembers:readfor the board;recognition:writefor the shortcut
1. Try the requests
sectionId and a section id from the first list to get just that section:
id, a name, a colour and its points. Points a young person earns count for the patrol they were in when they earned them.
2. Add the script
Go to script.google.com and choose New project. Call it Scoutworks scoreboard. Paste the script below and choose Save.Code.gs
3. Add your key and publish the board
Choose Project Settings (the cog), then Script Properties → Add script property. Property:SCOUTWORKS_API_KEY. Value: the sandbox key to try it, or a key with recognition:read and members:read.
Choose Deploy → New deployment → Web app, Execute as: Me, Who has access: Anyone, and copy the address. On the hut’s screen, open it with ?section=scouts (or a word from your section’s name) on the end, and make the browser full screen.
4. Make the points shortcut
Read your patrols’ ids from the standings request in step 1. Then, on an iPhone, open Shortcuts, choose + and call it Patrol points:- Choose from Menu with one item per patrol: Eagles, Owls and so on.
- In each patrol’s branch, a Text action holding that patrol’s
id. - Ask for Input, type Number, prompt “How many points?”. Negative numbers take points away.
- Current Date, then Format Date as
yyyyMMddHHmmss. This makes the award’sreference. - Get Contents of URL: your API address,
https://api.scoutworks.app/api/v1, then/patrol-scores. MethodPOST. Headers:Authorizationset toBearerand your key. Request Body JSON:items, a list holding one dictionary withreference(the formatted date and the patrol’s id),sectionId,patrolId(the Text) andpoints(the number). - Show Notification: “Points added”.
reference. If the hut’s Wi-Fi drops and the shortcut sends it again, Scoutworks answers unchanged and adds nothing twice.
5. Try one award
Run the shortcut and give one patrol 1 point. Within a minute the board shows it, and so does the section’s scoreboard in Scoutworks, marked as added by the key. To take it back, undo it on the scoreboard in Scoutworks.6. Switch to your group
The shortcut already usesapi.scoutworks.app. In the script, change api-demo.scoutworks.app to api.scoutworks.app, and put your own key with recognition:read and members:read in Script Properties. Then choose Deploy → Manage deployments → Edit, Version: New version, Deploy: the board’s address stays the same.
Variations
- Points for one young person. Send
memberIdin place ofpatrolId: the points count for them and for their patrol. - A whole evening at once. One request takes up to 100 awards, each with its own
reference.
If something goes wrong
See Errors for every code. An award with an error in the answer’sdata names what was wrong with it, such as a patrol from another section. The other awards in the request are still added.