I’m using the n8n automation platform to bulk add merit badges as “started” to a Scout’s advancement record before summer camp and later bulk update TroopTrack to mark a Scout’s merit badges as Completed assuming it was completed at summer camp. (This would save me a lot of time after being out in the woods for a week.)
Since there is no API endpoint that can fully accomplish this, I’ve:
- Used browser automation to mark a Merit Badge as started based on data captured in a Google Sheet,
- Used the GET /v1/user_achievements endpoint to determine the user_achievement_id based on what was added via the browser automation and add it to the associated row in my Google Sheet,
- (FUTURE) Use the POST /v1/user_achievements/{id} endpoint to mark the badge as completed based on the value of a column in the Google Sheet. I hope to add the images of the blue card via the API as well assuming I can figure out the syntax.
The Challenge
My challenge comes in the associating a Merit Badge name with its achievement_id. I pulled the list of available merit badges using the GET /v1/award_types/ end point to pull the list of available merit badges from TroopTrack and matched them to the list of badges scraped from All Merit Badges A-Z along with links to the PDF of the Merit Badge Pamphlets now available on the site.
I assumed that the merit badge without a year or “pre-year” name would be the most recent achievement_id to use in the automation, but this does not appear to be the case.
PROPOSED SOLUTIONS
- (Easiest) Be consistent in the names use for the merit badges. Consider aligning them to Scouting America’s names for all the most current merit badges. Only “Old” merit badges should include the last year the requirements was active.
- Add a field to the award_types/{id} API endpoint to include a true/false value to indicate whether the Merit Badge can be started at this time.
Slightly related to this ask would be to have the ability to mark a Merit Badge as started through the API and return the user_achievement_id.