Skip to main content
Many sections sing happy birthday at the meeting, or give a birthday badge or a card. This recipe lists the birthdays coming up, with the age each young person turns. It can also email the list to your leaders on the first of each month. 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. To send the email to other leaders, add a second property, SEND_TO, with their addresses. Put a comma between them. Without it, the email goes to you.

3. Run it

Choose birthdays in the toolbar and press Run. Open the Birthdays tab. To get the email too, run emailBirthdays once, so Google asks for permission to send email. Then add a trigger: choose Triggers (the clock), then Add Trigger. Function: emailBirthdays. Event source: Time-driven. Type: Month timer. Day: 1st. Choose Save.

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.
Dates of birth are personal data. Keep the sheet private to your leaders, and send the email only to leaders who need it.

Change it

  • One section. Change readAll('/members') to readAll('/members?sectionId=…') with the section’s id. Get the id from any member in the members list.
  • Further ahead. Change DAYS_AHEAD. For example, 7 gives this week only, for a weekly email.
  • A birthday on 29 February. In a year with no 29 February, the script shows the birthday on 1 March.