Skip to content

Updating visuals

If you see any images containing outdated UI, please bear with us.

We are updating all content as quickly as possible to mirror our new UI.

Google Sheets integration

Google Sheets lets you manage tabular data collaboratively. This integration enables your WeWeb backend to read rows, query by ID, insert new rows, update existing rows, and delete rows programmatically.

Use cases

  • Power lists and detail pages by reading spreadsheet rows
  • Append new form submissions as rows
  • Update rows by an identifier column
  • Remove stale rows from workflows
  • Use Google Sheets as a data source for tables — Add a table linked to a spreadsheet and sheet; configure views (columns, range) and bind them to Data Grids or fetch with Fetch table view.

Setup

  1. In Google Cloud, create a project and enable:

    • Google Sheets API
    • Google Drive API (needed to list your spreadsheets in WeWeb)
  2. Create a service account, then create and download a JSON key.

  3. In WeWeb, go to the Integrations tab → Google SheetsAdd connection.

  4. Add your credentials for each environment you use (Editor, Staging, Production):

    • Client Email — From the JSON key (client_email)
    • Private Key — From the JSON key (private_key)

    You can also upload the JSON key file in the connection screen to auto‑fill these fields.

  5. Share each spreadsheet: In Google Sheets, share the target spreadsheet with the service account email (Client Email) as Viewer or Editor so WeWeb can read or write.

  6. Test: In WeWeb, add a table (Data & APITablesAdd tableGoogle Sheets) or run the Get all rows action to confirm authentication and access.

Using Google Sheets as a data source for tables

Besides calling Google Sheets actions from workflows, you can use Google Sheets as a data source for tables in WeWeb. A table linked to Google Sheets reads rows from a spreadsheet and sheet you choose; the first row of the sheet is used as headers, and you configure a view (columns to return, optional range). That view can be bound to table components (e.g. Data Grid) or fetched from the interface with the Fetch table view action.

Add a Google Sheets table

  1. In WeWeb, go to Data & APITablesAdd table.
  2. Choose Google Sheets as the data source.
  3. Select your Google Sheets connection.
  4. Select Spreadsheet: the list is loaded from the Google Sheets API (you can refresh it). Then select Sheet (the tab name). WeWeb fetches the sheet's columns from the first row (headers); all columns are treated as text.
  5. Save. The table is now available in your project.

Configure a view

Views define which columns and range of data the table exposes. On the Google Sheets table you added:

  1. Create or edit a view for that table.
  2. Configure:
    • Columns to return — Select which header names to include, or leave empty for all columns. Options are loaded from the sheet's first row.
    • Range (under Range & Filters) — Optional. A1 notation (e.g. A2:Z1000). If empty, the backend fetches the used range of the sheet. Use this to skip a header row or limit rows.

When the view is loaded (e.g. by a table component or Fetch table view), the backend calls the Google Sheets API with the sheet name (or range), returns the first row as headers and the rest as rows. Each row is an object keyed by header name.

Use the table in the interface

  • Bind a view — In the binding menu, under Table Views, select the view. Bind it to a Data Grid, repeating group, or list.
  • Fetch table view — In an interface workflow, add the Fetch table view action, choose your Google Sheets table view, and pass any parameters the view expects.

Auto-generated API workflows for the table

When you add a Google Sheets table, WeWeb can create backend API workflows for that table:

  • Get Row by ID — Retrieve a single row by matching a column to a value.
  • Create Row — Append a new row using header‑mapped values.
  • Update Row by ID — Update a row matched by column + value.
  • Delete Row by ID — Delete the first matching row.

And you can then call these APIs from the interface (e.g. form submit → Create Row).

For the general pattern of tables, views, and fetching data, see Working with data and Fetch table view.

Using Google Sheets in the interface

  • Table views — Bind a Google Sheets table view to a Data Grid, repeating group, or list from the Table Views binding menu. Use the Fetch table view action in an interface workflow to load or refresh that view's data.
  • Actions — The five Google Sheets actions (Get all rows, Get row by ID, Insert row, Update row by ID, Delete row by ID) are available in backend workflows.

Common pitfalls (setup & usage)

Spreadsheet not shared with service account

If the target spreadsheet isn't shared with the service account email, it will not appear in the available spreadsheets. You must share the spreadsheet with your service account's email.

Headers missing

The integration relies on on the headers of the spreadsheet being in the first row. Ensure row 1 contains headers for each column.

All Actions

This integration provides five actions mapped to the Sheets API.

ActionDescription
Get all rowsRead rows from a sheet or range, with optional column selection
Get row by IDFind a row by matching an ID column to a value
Insert rowAppend a new row using header-mapped values
Update row by IDUpdate a row found by ID column and value
Delete row by IDDelete a row found by ID column and value

Action details

Get all rows

Read rows from a sheet or range and return an array of objects keyed by header name.

Inputs

Display KeyExample InputDescriptionRestrictions
Spreadsheet"1AbC...xyz"Target spreadsheetRequired
Sheet Name"Products"Named sheet to readRequired
Columns to return
Optional
["Name","Price"]Columns to include in the responseColumn headers must exist
Range
Optional
"A2:Z1000"Limit the range to fetch (A1 notation)If empty, uses the sheet’s used range
Value Render Option
Optional
"FORMATTED_VALUE"Value formatFORMATTED_VALUE, UNFORMATTED_VALUE, FORMULA
Major Dimension
Optional
"ROWS"Returned dimensionROWS, COLUMNS

Example output

json
[
  {
    "Name": "Widget",
    "Price": "10.00"
  },
  {
    "Name": "Gadget",
    "Price": "25.00"
  }
]

Documentation of API endpoint that powers action: Google Sheets API – spreadsheets.values.get

Get row by ID

Find and return a single row by matching an ID column to a value.

Inputs

Display KeyExample InputDescriptionRestrictions
Spreadsheet"1AbC...xyz"Target spreadsheetRequired
Sheet Name"Products"Named sheet to searchRequired
ID Column"id"Column to match (picked from the sheet’s header row)Must exist as a header
Value"sku-123"Value to match in the ID columnText
Columns to return
Optional
["Name","Price"]Columns to include in the responseColumn headers must exist

Example output

json
{
  "id": "sku-123",
  "Name": "Widget",
  "Price": "10.00"
}

Returns null if no matching row is found.

Documentation of API endpoint that powers action: Google Sheets API – spreadsheets.values.get

Insert row

Append a new row mapped to the sheet's header row.

Inputs

Display KeyExample InputDescriptionRestrictions
Spreadsheet"1AbC...xyz"Target spreadsheetRequired
Sheet Name"Products"Named sheet to append toRequired
Select columns to include
Optional
["id","Name","Price"]Choose which columns to includeLeave empty for all columns
Values{"id":"sku-123","Name":"Widget","Price":"10.00"}Column names and values for the new rowKeys must match header names
Value Input Option
Optional
"USER_ENTERED"Input modeRAW or USER_ENTERED

Example output

json
{
  "spreadsheetId": "1AbC...xyz",
  "tableRange": "Products!A1:C1",
  "updates": {
    "spreadsheetId": "1AbC...xyz",
    "updatedRange": "Products!A5:C5",
    "updatedRows": 1,
    "updatedColumns": 3,
    "updatedCells": 3
  }
}

Documentation of API endpoint that powers action: Google Sheets API – spreadsheets.values.append

Update row by ID

Update a row matched by ID column and value.

Inputs

Display KeyExample InputDescriptionRestrictions
Spreadsheet"1AbC...xyz"Target spreadsheetRequired
Sheet Name"Products"Named sheet to updateRequired
ID Column"id"Column to match (picked from the sheet’s header row)Must exist as a header
Value"sku-123"Value to match in the ID columnText
Select columns to include
Optional
["Price"]Choose which columns you want to updateLeave empty for all columns
Values{"Price":"12.00"}Column names and new valuesKeys must match header names
Value Input Option
Optional
"USER_ENTERED"Input mode when writingRAW, USER_ENTERED

Example output

json
{
  "spreadsheetId": "1AbC...xyz",
  "updatedRange": "Products!A3:C3",
  "updatedRows": 1,
  "updatedColumns": 3,
  "updatedCells": 3
}

Documentation of API endpoint that powers action: Google Sheets API – spreadsheets.values.update

Delete row by ID

Delete the first row that matches the ID column and value.

Inputs

Display KeyExample InputDescriptionRestrictions
Spreadsheet"1AbC...xyz"Target spreadsheetRequired
Sheet Name"Products"Named sheet to delete fromRequired
ID Column"id"Column to match (picked from the sheet’s header row)Must exist as a header
Value"sku-123"Value to match in the ID columnText

Example output

json
{
  "spreadsheetId": "1AbC...xyz",
  "replies": [{}]
}

Returns null if no matching row is found (fails silently).

Documentation of API endpoint that powers action: Google Sheets API – spreadsheets.batchUpdate (deleteDimension)

Error handling

Error code and typeReason
401 UnauthorizedInvalid or missing credentials.
403 ForbiddenSpreadsheet not shared with the service account or insufficient IAM permissions.
404 Not FoundSpreadsheet or sheet not found.
400 Bad RequestInvalid range or parameters.
429 Too Many RequestsRate limited; backoff and retry.
500 Internal Server ErrorProvider-side error; retry with backoff.

FAQs

Why can’t I see my spreadsheet in the Spreadsheet dropdown?

Check these points:

  • Make sure the Google Drive API is enabled in your Google Cloud project.
  • Make sure the spreadsheet is shared with the service account email (Client Email).
  • If you just changed API settings or sharing permissions, refresh the dropdown and try again.
Why do I get a 403 error even though I shared the spreadsheet?

This usually means Google still isn’t letting the service account access the file.

  • Make sure you shared the spreadsheet with the exact service account email (Client Email).
  • Give the right permission:
    • Viewer is enough for read actions
    • Editor is required for insert, update, and delete actions
Why are my column options missing (or look wrong)?

WeWeb uses the first row of your sheet as the column names.

If row 1 is empty, has duplicate names, or changes often, the mapping can break.

Fix it by:

  • Making sure row 1 contains stable, unique column names
  • Refreshing the columns in the action (or reselecting the sheet)
Why does Insert row or Update row by ID write to the wrong column?

In the Values object, the keys must match your column names exactly (including spaces and capitalization).

If you renamed columns after building the workflow, reselect the sheet/columns so WeWeb refreshes the available columns.

Why does Delete row by ID delete only one row?

It deletes the first matching row only (even if multiple rows match).

If you need to remove several rows, fetch the rows first and then loop through them.

How do I avoid creating duplicate rows?

A common pattern is:

  1. Run Get row by ID (for example using an email column).
  2. If it returns null, run Insert row.
  3. If it returns a row, run Update row by ID instead.
How do I find the Spreadsheet ID?

Copy it from the spreadsheet URL between /d/ and /edit.

Do I need a specific header row?

Yes. The first row is used as headers for mapping values in insert/update actions.