Wire up the forms backend
The arrival survey and the pick-one pledge both submit to a Google Apps Script web app you own, which writes to a Google Sheet you own. The live results page reads back from the same Sheet. You set this up once, paste one URL into a config file, done.
The setup
Create the Google Sheet
Go to sheets.new (signed in as your S2 account). Name the file: AI Studio at S2 — Form Submissions.
Don't add any columns yet. The Apps Script will create the headers automatically on the first submission.
Open the Apps Script editor
From the Sheet, click Extensions → Apps Script. A new tab opens with a code editor showing a default function myFunction().
Delete everything in the editor.
Paste the code
Copy this entire block and paste it into the Apps Script editor:
Click the disk icon (or Cmd+S) to save. Project name doesn't matter.
Deploy as a web app
Click Deploy → New deployment.
- Click the gear icon next to "Select type" and choose Web app.
- Description: "AI Studio forms backend" (or anything).
- Execute as: Me.
- Who has access: Anyone (this allows staff to POST submissions without signing in).
Click Deploy. The first time, Google will ask you to authorize the script. Approve the standard permissions. You may need to click "Advanced" → "Go to (your project)" to get through the unverified-app warning. The script needs access to your spreadsheet — that's expected.
Copy the web app URL
After deploying, Google shows you a Web app URL that looks like:
Copy this URL.
Paste it into the site config
Open ai-studio/assets/config.js in your text editor. Find this line:
Paste your URL between the quotes:
Save the file. Reload the site. Done.
Updating an existing deployment (org + session labels)
If you set this up before session labelling was added, do this once. Until you do, submissions keep working exactly as before — they just won't carry an organization or session label, and the results page will show them as (unlabelled).
- Open your Sheet → Extensions → Apps Script.
- Select everything in the editor and replace it with the code in step 3 above (it now includes the org/session handling).
- Save, then Deploy → Manage deployments → Edit (pencil) → Version: New version → Deploy. The URL does not change, so
config.jsneeds no edit. - Open poll control and fill in Organization and Session, then Save.
Your existing data is safe. The script adds the two new columns to the right-hand end of each tab rather than rewriting anything, and it writes rows by column name rather than by position — so old rows keep their values and simply have blank org/session cells.
The same redeploy enables the poll archive, which needs two things this version of the script adds: a pollsessions endpoint that lists every org/session/question combination in the Sheet, and optional session, org and allSessions parameters on the poll read. The projector is unaffected — asked with no parameters, the poll read still returns the current session only, exactly as before.
Why this beats deleting rows between sessions: you keep every cohort's data, the results page can show one session or all sessions for an organization, and the live poll automatically shows only the current session's answers instead of blending two groups' word clouds.
Test it
Open the arrival survey and submit a test response with your own name. Then open the live results page. Your test response should appear within 10 seconds.
Open your Google Sheet — you should see a new tab called survey with your response as a row.
If you want, delete the test row from the Sheet before the real survey goes out.
Things to know
Updating the script later
If you change the Apps Script code, you need to re-deploy: Deploy → Manage deployments → Edit (pencil icon) → Version: New version → Deploy. The URL stays the same, so you don't have to update config.js again.
Sharing the Sheet with Monica
Click Share on the Sheet and add Monica as an Editor (or Viewer if you don't want her to delete rows). The survey, pledge, and live-poll data each land in their own tab (survey, pledge, poll), created automatically on first use.
Editing or deleting a response
Every row now also carries an org and a session, stamped automatically from whatever is set in poll control at the time — phones send nothing extra, so there is nothing for a participant to get wrong. Every submission is one row in its tab, with the name (survey and pledge) shown. To fix a typo, edit the cell. To remove a duplicate or test entry, delete the row. The live results, lobby, and poll screens re-read the Sheet every few seconds, so any change shows up on its own. Live-poll answers are anonymous by design (no name column).
Privacy
The web app accepts submissions from anyone (because the site is password-gated, that's effectively S2 staff). Submissions land in your S2 Google account. No third-party service involved.
Rotating the password
The site password ("AI@S2Training") is in assets/script.js. To rotate it: change the SHARED_PASSWORD constant. The Apps Script URL doesn't need to change.
If submissions stop working
- Open the Apps Script editor and click Executions in the left sidebar. Look for failed runs and their error messages.
- Re-deploy a new version (Deploy → Manage deployments → Edit → New version).
- If Google asks for re-authorization, approve it. It happens occasionally.