Skip to main content
  • For: section leaders and badge secretaries
  • You get: a Badges to order tab with how many of each badge to buy and who each is for
  • Time: about five minutes
  • Scopes: badges:read and badge-stock:read
Before you order badges, you need to know how many of each one to buy. This recipe builds that list in a Google Sheet. It counts every badge that is completed but not yet awarded, names who gets each one, and takes off the badges already on your shelf, so To order is what to buy.

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 badgesToOrder in the toolbar and press Run. Open the Badges to order tab. Each row is one badge: how many are owed, how many are on the shelf, how many to order, and who they are for. The stages of a staged badge share one shelf count. Run it again each time you place an order. When you give a badge out, mark it as awarded in Scoutworks, or record it through the API with POST /badge-awards/bulk (badges:write). Either way it leaves this list, and the badge is taken from stock in Scoutworks.

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 the badges:read and badge-stock:read scopes.

Variations

  • A button in the sheet. Add this function, then reload the sheet. A Scoutworks menu appears with the command in it.
  • Badges on the way. Change status=completed to status=in_progress to see what young people are working on now. It helps you order early.
  • Badges ticked on the night. The Badge evening sheet signs requirements off from a sheet. A badge whose last requirement it signs off is completed, and appears here.
  • Record the delivery. When the order arrives, Reorder badges and uniform adds it to the shelf count in Scoutworks.
  • One young person. Add &memberId= and a member’s id to see every badge record for one person. Get the id from the members list.