Skip to main content
  • For: group admins moving to Scoutworks from a spreadsheet
  • You get: each row added as a member, in the right section and patrol, with its Scoutworks id
  • Time: about twenty minutes
  • Scopes: members:read, members.contacts:read and members:write
Moving to Scoutworks from a spreadsheet? This recipe adds each row of a Google Sheet as a member, in the right section and patrol. Each row gets the member’s id back, so running it again never adds anyone twice. It takes about twenty minutes, most of it tidying the sheet. It is for a group admin. Try it on one test row first: see step 5.

1. Create a key

In Scoutworks, open Settings → Integrations → API keys and create a key called Spreadsheet import, with the scopes members:read, members.contacts:read and members:write. Copy the key: you see it once. Members the sheet adds show you as the person who added them, and Scoutworks records the key on each one. Parents are not emailed. Invite them from Scoutworks when you are ready.

2. Lay out the sheet

Make a tab called Import with these columns, in this order: Format column C as Format → Number → Date. Leave column I empty: the script fills it in.

3. Add the script and the dropdowns

1

Paste the script

Choose Extensions → Apps Script, delete what is there, paste the script below and choose Save.
2

Add your key

Choose Project Settings → Script Properties → Add script property. Property: SCOUTWORKS_API_KEY. Value: your key.
3

Fill the dropdowns

Back in the sheet, reload it. Choose Scoutworks → Load sections and patrols. The script adds a Lists tab with your sections and patrols from Scoutworks, and turns columns D and E into dropdowns of them. Pick from the dropdowns rather than typing: a section Scoutworks does not know cannot be imported.
Code.gs

4. Check the sheet

  • Every row has a first name, a last name and a section from the dropdown.
  • Dates of birth are real dates, not text. A date in the future is refused.
  • Each parent email is spelt right. A parent with the same email on two rows is linked to both children, as one person.

5. Try one row, then the rest

1

Add one row

Choose Scoutworks → Add the first row not yet added. Column I fills with the member’s id. Open the member in Scoutworks and check the section, patrol and parent.
2

Add the rest

Choose Scoutworks → Add every row not yet added. The script adds about 28 rows a minute. A large sheet may stop after six minutes, Google’s limit for one run: choose it again and it carries on where it stopped.
If the test row was wrong, archive that member in Scoutworks, fix the row, clear its column I and add it again. The corrected row is sent as a new request. Sent unchanged within 24 hours, it would answer with the member you archived: restore them in Scoutworks instead.

Rows that say “Check”

The API answered 409 possible_duplicate: Scoutworks already has a member with this name and date of birth, or this name and parent email. Column I lists their ids. Look them up in Scoutworks. If the row really is a different young person, the script can add it anyway: change '/members' to '/members' + '?allowDuplicate=true' in importRow, add that row, then change it back. See Errors for every code.