Google Sheets
Connect a Google account so your app can write form responses and data into Google Sheets, read rows back, and create new spreadsheets
Overview
Google Sheets is built into Pentoggle as a first-class integration. Connect a Google account once — usually your own, as the app owner, via the business account connection — and your app can append rows to any spreadsheet that account can edit, read rows back, and create new spreadsheets.
The classic flow this powers: a form on your app that anyone can fill in (they can even sign in with Zoho first), with every submission landing live in your Google Sheet.
By default the app creates its own spreadsheet on the first submission — headers and all — so there are no spreadsheet ids to find; mention an existing sheet only if you want responses flowing into one you already use.
Note this is different from Sign in with Google, which is a login method. This integration is about your app working with spreadsheets; an app can use both independently.
What it supports
- Business account connection — you (the app owner) connect your Google account once in Settings; your app can then write into your sheets even from public pages or scheduled jobs where nobody is signed in — the right setup for form-to-sheet flows
- Per-user connections — alternatively, each signed-in user can connect their own Google account so the app works with their spreadsheets
- Append rows —
google.appendRow(...)adds one or many rows to a chosen sheet tab; new submissions appear in the spreadsheet within a second or two - Read rows —
google.readRows(...)pulls data back out (e.g., show responses in an admin dashboard, or use a sheet as a lightweight content source) - Create spreadsheets —
google.createSpreadsheet(...)makes a new spreadsheet (with tabs and a header row) owned by the connected account - Formula-safe by default — visitor input is written as plain text, so nobody can plant a live formula in your sheet by typing
=IMPORTXML(...)into a form - Automated / scheduled actions — combined with Scheduled tasks, apps can log a daily snapshot to a sheet or read a sheet on a schedule
- Token storage and refresh — Pentoggle stores tokens encrypted and refreshes them automatically in the background
Apps you can build
- Form builder with a Sheets backend — a Google Forms equivalent: visitors (optionally signed in with Zoho or Google) submit a form, and every response lands as a row in your Google Sheet in real time
- Event or webinar registration — registrations flow into the sheet your operations team already works in; a scheduled job reads it back to send reminder emails
- Lead capture for a sales team — a public inquiry form appends leads to the team's shared sheet, with a timestamp and source column, no CRM required
- Field-survey collection — staff submit inspections or survey entries from their phones; each entry appends to a per-project spreadsheet tab
- Sheet-driven dashboard — the app reads a sheet your team maintains (pricing, inventory, schedules) and renders it as a polished, always-current page
- Expense or request tracker — employees file requests through the app; each one appends to the finance sheet, and an admin view reads back the latest rows
Example prompts
"Build a feedback form — name, email, rating, comments.
Save every submission to my Google Sheet."
"Visitors sign in with Zoho, fill the registration form,
and each response is added to my Google Sheet."
"Add an admin page that shows the latest 50 rows from
the responses spreadsheet."
"Every Monday at 9am, read last week's rows from the
sheet and email me a summary."Setting up Google for your app
Google requires each app creator to register their own Google Cloud OAuth client (free, about ten minutes) so the consent screen is branded as yours and Google's quotas apply per app.
- Create a Google Cloud project and enable the Sheets API
- Go to console.cloud.google.com and create a project. Company (Workspace) account? In the project picker, select your organization first, then create the project inside it — a project outside your organization fails later with
Error 403: org_internalwhen you connect - Open APIs & Services → Library, search for Google Sheets API, and click Enable
- Go to console.cloud.google.com and create a project. Company (Workspace) account? In the project picker, select your organization first, then create the project inside it — a project outside your organization fails later with
- Configure the consent screen (Google Auth Platform)
- Open Google Auth Platform (search it in the Console top bar; older consoles: APIs & Services → OAuth consent screen). Under Branding, fill in the app name and support email
- Under Audience, pick Internal (company Workspace — recommended) or External (personal Gmail; while in Testing status, add each connecting account under Test users)
- Under Data Access, add the scope
https://www.googleapis.com/auth/spreadsheets
- Create the OAuth client
- Under Clients, click Create client and choose type Web application (older consoles: APIs & Services → Credentials → Create Credentials → OAuth client ID)
- Under Authorized redirect URIs, add exactly:
https://pentoggle.com/api/baas/oauth/google/callback - The URL must be byte-identical — no trailing slash, no
http://, no query parameters. Your app's Settings → OAuth Providers → Google card shows it with a copy button
- Copy your credentials
- Copy the Client ID and Client Secret shown after creation (also available from the Credentials list)
- Add them in Pentoggle
- Open your app and go to the Settings tab
- Find the OAuth Providers section and click the Google card
- Paste your Client ID and Client Secret, then click Save — the status flips from Setup needed to Ready
While your consent screen is in Testing status, Google expires connections after 7 days — you'll need to hit Reconnect in Settings weekly. Publish the consent screen (Google shows an "unverified app" notice until you complete verification, which is fine for your own account) and connections stop expiring.
Connecting the business account
For the form-to-sheet flow, connect your Google account once: in the same Settings → OAuth Providers → Google card, use the Business account → Connect button and sign in with the Google account that owns (or can edit) the target spreadsheet. Make sure the spreadsheets checkbox is ticked on Google's consent screen — Google lets you uncheck individual permissions.
The card shows the connection's health and lets you reconnect or disconnect at any time. Staging and production each hold their own connection, so testing never touches your production sheet.
How it works
- You (or a user) approve the connection on Google's consent screen, branded with your Google Cloud project
- Pentoggle exchanges the code for tokens server-side and stores them encrypted; your app's frontend never sees them
- On the first submission, the app creates its spreadsheet (with column headers) in the connected account's Drive and remembers it — you never hunt for a spreadsheet id. If you asked for an existing sheet instead, the app uses that sheet's id (the long id in its URL:
docs.google.com/spreadsheets/d/<id>/edit) - Public form submissions use the business connection, so they work with no signed-in user — the form function's own access policy is the guard rail
- Access tokens are refreshed automatically in the background; with a published consent screen, the connection persists until you revoke it
Limitations
- Sheets only, for now — Gmail, Drive, and Calendar are not wrapped yet. For Google login, use Sign in with Google
- Append and read, not edit — updating or deleting existing rows and cell formatting are not supported yet; the sweet spot is collection (append) and display (read)
- The connected account needs edit access — to write into an existing sheet, that sheet must be owned by or shared (as editor) with the connected Google account
- Testing-status connections expire weekly — until you publish your OAuth consent screen, Google invalidates connections after 7 days (see the setup note above)
- Google's per-minute quotas apply — the Sheets API allows roughly 60 requests per minute per user; ample for forms and dashboards, not for high-frequency streaming writes
Troubleshooting
- "redirect_uri_mismatch" — the URI in your Google Cloud OAuth client must be exactly
https://pentoggle.com/api/baas/oauth/google/callback. No trailing slash, nohttp://, no query string - "Error 403: org_internal" — your consent screen is set to Internal but the connecting account isn't in the organization that owns the Cloud project. Usually the project was created outside your organization (see setup step 1) — recreate it inside the org, or switch the consent screen to External and add yourself as a test user
- "Access blocked: app has not completed verification" — the connecting account isn't in your consent screen's Test users list (Testing status), or hit Continue past the unverified-app notice (published status)
- "The connected Google account does not have access to this spreadsheet" — share the sheet with the connected account (the email shown on the Settings card), or double-check the spreadsheet id copied from the URL
- "No spreadsheet with that id" — the id was mistyped or truncated; re-copy the long id between
/d/and/editin the sheet's URL - Missing-permission error on every call — the spreadsheets permission wasn't granted; hit Reconnect in Settings and make sure the spreadsheets checkbox is ticked on Google's consent screen
- "Google Sheets API is not enabled" — enable it in your Cloud project under APIs & Services → Library
- Connection worked last week, fails today — your consent screen is in Testing status and the 7-day expiry hit; reconnect, and publish the consent screen to stop this recurring