- For: treasurers and trustees
- You get: a Restricted funds tab with one row per fund, and a Fund movements tab with every transfer in and out
- Time: about ten minutes
- Scopes:
accounting:read
1. Try the request
Paste this into a terminal to see the demo group’s funds:2. Add the script
In your Google Sheet, choose Extensions → Apps Script. Delete what is there, paste the script below and choose Save.Code.gs
3. Add your key and run it
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. Then choose restrictedFunds and press Run.
Open funds come first. A fund that has spent more than it holds says Overspent: the overspend has come out of general funds, and the trustees should know.
4. Switch to your group
Changeapi-demo.scoutworks.app to api.scoutworks.app, and replace the sandbox key with your own. The key needs only accounting:read. The sheet holds no names, so it is safe to share with every trustee.
For the annual accounts
The figures are for the whole life of each fund, not for one accounting year. For the restricted funds note in your annual accounts, you need each fund’s balance at the start and end of the year, and what came in and went out in between:- In and out during the year: read the transactions with
fromandtoset to the year. Keep each line whoserestrictedFundIdis the fund. A split line carries its fund on each entry insplitsinstead, so add up the split amounts whoserestrictedFundIdis the fund too. Then add the fund’s movements dated in the year. - The opening balance: the fund’s
allocated, plus every line and movement dated before the year starts. A read withfromandtogives only the year itself.
If something goes wrong
403 insufficient_scope: the key does not haveaccounting:read.- A fund is missing: every fund is listed, open and closed. Check the fund was set up as a restricted fund in Scoutworks, not as a budget.