Skip to main content
This recipe turns your events into a calendar feed. People subscribe to it once. When a leader adds or moves an event in Scoutworks, the change reaches their calendar on its own. You can make one feed for the whole group, or one for each section. It uses a free Google Apps Script web app. It takes about ten minutes.

1. Add the script

1

Create a project

Go to script.google.com and choose New project. Call it Scoutworks calendar.
2

Paste the script

Delete what is there and paste the script below. 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. Choose Save script properties.

3. Publish it as a web app

1

Start a deployment

Choose Deploy → New deployment. Next to Select type, choose the cog, then Web app.
2

Set who can use it

  • Execute as: Me
  • Who has access: Anyone
Choose Deploy. Google asks for permission the first time: the script needs to reach an external service.
3

Copy the address

Copy the Web app URL. It ends in /exec. Open it in your browser to check it: you get a short text file that starts with BEGIN:VCALENDAR.
For one section, add ?section= and a word from the section’s name to the end of the address. For example, …/exec?section=cubs gives only the Cubs’ events, plus the events for the whole group. Choose a word that only one section’s name has: scout also finds “Explorer Scouts”.

4. Subscribe to it

Calendar apps check a subscribed feed on their own timetable, often every few hours. Google Calendar can take up to a day. You cannot make it faster.
Anyone with the address can see your events: titles, times and places. The feed never holds the names of young people. Share the address only with your parents and leaders. If it gets out, choose Deploy → Manage deployments, archive the deployment, and create a new one. The new one has a new address.

5. Switch to your group

In the script, change api-demo.scoutworks.app to api.scoutworks.app. In Script Properties, replace the sandbox key with your own. Your key needs the events:read scope. Give it no other scope. After you change the script, choose Deploy → Manage deployments → Edit (the pencil). Set Version to New version and choose Deploy. The address stays the same. If you create a new deployment instead, you get a new address, and your subscribers do not see the change.

Notes

  • The feed holds events from 30 days ago to one year ahead. Change the 30 and 365 in doGet to change this.
  • The script keeps each feed for one hour, so a change in Scoutworks reaches the feed within an hour. This also stops repeated requests from using up your API limit.
  • Only published events are in the feed. Drafts and leaders-only events never are.
  • Each event keeps its Scoutworks ID in the calendar, so a moved event moves in the calendar. It does not appear twice.