One Google Sheet becomes the database. Phones connect by scanning a QR code. AI photo-fill is optional and can be switched on for the whole team with a single key. This guide shows every click.
You need: a Google account, a computer for step 1, and the phones that will collect data. Use → / ← or swipe to move between slides.
sheets.new — a new Google Sheet opens. Name it, e.g. Village Survey 2026.github.com/pulakeshpradhan/geosurvey → folder backend → Code.gs → copy icon. Paste into the empty code page.< >) click appsscript.json, delete its text and paste backend/appsscript.json from GitHub.var ADMIN_TOKEN = 'GeoSurvey'; — this is the team key. Keep it for a trial; for a real project replace GeoSurvey with your own key (keep the quotes).script.google.com/home/usersettings and switch Google Apps Script API to On. (This only lets your own script update itself; it exposes nothing.)myFunction or doPost. Change it to authorizeDrive and click ▶ Run./exec.pulakeshpradhan.github.io/geosurvey, tap ⚙️, paste the Web app URL into Database endpoint, tap Test database → Backend OK → Save.aistudio.google.com/app/apikey, sign in, Create API key, Copy (starts with AIza). Free.var AI_KEY = ''; and paste the key between the quotes. Ctrl+S.updateBackend → ▶ Run. Done: every connected phone now has Analyze & fill (Google’s Gemma 4), with no key on the phone.The first time, the app asks how to start. Pick one (needs the team key once a database is connected):
.geosurvey file installs the questionnaire and connects the phone to the database. Every Publish saves one to the Drive folder automatically.Change it any time with the Edit button (team key). Apply = this phone. Publish to team = every phone gets it.
±8 m. Village, block and PIN come from the map — correct them if wrong.Records tab: Sync sends what is waiting and shows your records straight from the database. Sync all shows everyone’s — it asks for the team key once. Rows marked database come from other phones. Files in Drive shows links, or Upload files if a photo did not arrive. The Drive folder also holds Rows marked database come from other phones. Files in Drive shows links, or Upload files if a photo did not arrive.
Downloads: Records → CSV, JSON, SPSS (.sav), KMZ (Google Earth). Analysis tab → automatic statistics and a plain-language report. Data (header button, team key) → every submission from every phone, with statistics, exports and delete.
| You see | Do this |
|---|---|
| “Backend is older than the app” | Settings → Test database updates it. “Apps Script API is off” → step 1C.1. “Not authorised” → steps 1B.2 and 1C.2. A backend older than v1.15.4 needs Code.gs pasted once more (steps 1B–1D). |
| “AI error” / “backend has no AI key” | Step 3: paste the key into AI_KEY and run updateBackend. Per-phone key: Settings → Test connection. |
| “permission to call DriveApp” | Step 1C was skipped: run authorizeDrive and Allow, then Records → Upload files. |
| “Team key not accepted” | It must match ADMIN_TOKEN in Code.gs exactly (capital letters matter). |
| “Locating…” never finishes | Allow location when the phone asks; move near a window or outside; tap ⟳ Refresh. |
| Camera or microphone does not open | Allow camera and microphone for the site in the phone’s browser settings. |
| App looks old after an update | Close it completely and open again. |
That’s it. Open pulakeshpradhan.github.io/geosurvey and start.
| What | Where |
|---|---|
| The app | https://pulakeshpradhan.github.io/geosurvey/ |
| New Google Sheet | https://sheets.new |
| Backend code to paste | https://github.com/pulakeshpradhan/geosurvey/blob/main/backend/Code.gs |
| Manifest to paste | https://github.com/pulakeshpradhan/geosurvey/blob/main/backend/appsscript.json |
| Apps Script API switch | https://script.google.com/home/usersettings |
| Free AI key (optional) | https://aistudio.google.com/app/apikey |
| Written guide | https://github.com/pulakeshpradhan/geosurvey#readme |
Print all slides (top right) gives a one-page-per-step handout. Created by Pulakesh Pradhan.