This is a Google Script that creates new cards in Trello for any form submissions that come into our mutual aid network. It was inspired by this blog post, sent to us by friends in our Lowell Mutual Aid Network.
Mutual Aid Medford and Somerville (MAMAS) uses a Google Form (called the "Needs Form") to take in requests for support. In order to ensure we're making connections between specific requests for support and offers for support, we use Trello. This script enables the connection between the Needs Form and associated Trello board. Google Scripts such as this one connect to Google Apps, like Forms, to deliver additional functionality.
Importantly, the script in this repository is not currently driving the functionality in the live Needs Form. Instead, making changes to the live script requires a specific and manual deployment process. That process is described below.
At present, the most frequent use cases for changing this script are as follows:
- A major section is added to or removed from the Needs Form.
- A new Needs Form is created, requiring a script to be added.
- A translation to the section titles needs to be added or updated. This is frequently required alongside use case 2.
- Navigate to the Google Form that requires the script to be attached or an update. Once there, click on the three vertical dots, then click on Script Editor.
- You should now see an editor. Copy/paste the code from the
script.gs
file into the editor. - In the following steps, you will establish the constants used in this form's instance of the script. First, create a new API token and key for your Trello account by following the steps provided by Trello. Once you have them, return to the editor and copy/paste the token inside the quotation marks, replacing where it says
[TRELLO API TOKEN]
. Next, copy/paste the key inside the quotation marks where it says[TRELLO API KEY]
. - In the following steps, you will get the identifiers for the Trello board to which the Form responses are added.
- Go to the Trello board to which Needs Form responses will be sent and navigate to the URL bar. Replace the name at the end of the URL (such as
/tech-team-tasks
) with/reports.json
. This will return a bunch ofJSON
text. - Find the place in the text where it says
id
(this should be fairly early in the text), and copy the (not so) random string of letters and numbers from there into the quotation marks in the Form script where it says[ID FOR THE TRELLO BOARD]
. - Use
CTRL-F
orCMD-F
to search thereports.json
text content for the name of the Trello column into which you want to add new cards. Once you find the name, you should see a field next to it calledid
again. Copy the (not so) random string of letters and numbers for thisid
(which should be different from the one before) and paste it into your script where it says[ID FOR THE LIST IN WHICH TO PUT THE CARD]
.
- Go to the Trello board to which Needs Form responses will be sent and navigate to the URL bar. Replace the name at the end of the URL (such as
- In this step, you will create the constants that we use to delinate the different sections. Search the script for the
cardStartHeaders
object variable. For each of the sections ("money"
,"supplies"
, etc.), find the associated "Section Start" question in the Needs Form. Copy that "Section Start" text in to the key string of thecardStartHeaders
object. Once all the keys are populated with the appropriate language's questions, you are done with this step.- If you need help with this step, reach out to the
#wg-translation
team liasion (currently Sam L.).
- If you need help with this step, reach out to the
- Now that all the script constants are filled in, go to
Run
in the navigation bar and run theinit()
function. This will create the trigger for the Needs Form to which the script is attached. Now, any time your form gets a new submission, it will run thesubmitToTrello()
function. - Once
init()
has been run, the Form should be up and running! Feel free to celebrate with a pastry, or a self hi-five, or whatever other way you like to acknowledge achievements. 😄- If it's not up and running, feel free to email askyourtechmamas@gmail.com or ask in the
#tech-team
Slack channel for help!
- If it's not up and running, feel free to email askyourtechmamas@gmail.com or ask in the