# Google Sheets

Save form-style chat messages as spreadsheet rows, and read or write Google Sheets from automations

The Google Sheets integration turns structured customer replies — order details, booking requests, form answers — into rows in a Google Sheet. Your team saves a message with one click from the inbox, and automations can add, update, look up and delete rows on their own.

## What it can do

- **Save a message as a row** — Right-click a message that contains `Key : Value` lines and Qwetty writes each value into its own column
- **Columns grow by themselves** — A key the sheet has not seen before becomes a new column, so different customers can send different fields
- **Choose the destination per message** — Create a new spreadsheet or pick an existing one each time; the destination is never fixed to the connection
- **See what was already saved** — Saved messages carry a badge that links to the spreadsheet
- **Eight automation steps** — Append, update, upsert, look up or delete rows, increment a cell, or create a spreadsheet

## Connecting Google Sheets

1. Go to **Integrations** and find **Google Sheets** on the **Catalog** tab
2. Click **Connect**
3. Sign in with the Google account that should own the spreadsheets, and approve access
4. The details window now shows **Your connection** with the **Google account** you used

You need the **Connect** permission for Integrations. The connection counts toward your plan's integration limit — see [Integrations Overview](/en/integrations/overview#plan-limits).

### What Qwetty can access

Qwetty asks Google for two permissions:

- **Create new spreadsheets and access only the sheets and folders you select via Google's file picker**
- **See the email address of the connected Google account**

Qwetty cannot browse your Drive. It only works with spreadsheets it created itself and with spreadsheets or folders you pick in Google's file picker.

## Saving a message to a sheet

The **Save to Google Sheet** item appears on messages that contain at least one line shaped like `Key : Value`. For example:

```text
Name : Budi Santoso
Email : budi@example.com
Product : Deluxe package
Note : Deliver after 5 pm
```

1. In the inbox, right-click the message
2. Under **Integrations**, choose **Save to Google Sheet**
3. In **Save message to Google Sheet**, pick a destination:
   - **Create new** — Enter a **Spreadsheet title**. Optionally choose a **Destination folder** with **Pick a Drive folder…**; without one, the new sheet goes to your Drive root. The row is written to the first tab, `Sheet1`
   - **Use existing** — Click **Pick a spreadsheet…** and choose the file in Google's picker, then enter the **Sheet tab** to write to (`Sheet1` if left empty)
4. Click **Save row**

A toast confirms **Saved row to** followed by the spreadsheet name, and the message gets a **Saved** badge linking to it.

### How the row is built

- The first row of the tab holds the column headers. The first column is always `timestamp` — the time the message was sent
- Each `Key : Value` line becomes one column. Qwetty splits each line at the first colon, so values that contain colons (such as links) stay intact
- Lines without a colon are ignored, so a message can mix prose and fields
- Keys are matched without regard to case, so `Email` and `email` fill the same column. If a key appears twice in one message, the last value wins
- New keys are added as new columns at the right. Existing columns are never reordered or removed

:::note
Saving the same message again adds another row. The dialog warns you first with **Already saved to** followed by the spreadsheet name.
:::

## Using Google Sheets in automations

When Google Sheets is connected, the **Integrations** category of the node picker offers these steps:

| Step | What it does |
|------|--------------|
| **Google Sheets: Append row** | Adds a row from a JSON map of column header → value. New columns are added automatically |
| **Google Sheets: Append parsed row** | Reads `Key : Value` lines from text (by default the trigger message, `{{triggerPayload.body}}`) and adds them as a row |
| **Google Sheets: Update row** | Overwrites columns on the first row whose match column equals a value |
| **Google Sheets: Upsert row** | Updates the matching row, or adds a new one if none matches |
| **Google Sheets: Look up row** | Finds a row and makes its cells available to later steps |
| **Google Sheets: Delete row** | Deletes the first row that matches a value |
| **Google Sheets: Increment cell** | Adds a number to one cell, such as a daily counter |
| **Google Sheets: Create spreadsheet** | Creates a new spreadsheet and returns its ID and link |

Common fields:

- **Spreadsheet ID** — The spreadsheet to use. It must be one Qwetty created or one you picked in Google's picker. You can use the ID from an earlier **Create spreadsheet** step, `{{integrationResult.spreadsheetId}}`
- **Sheet tab** — The tab name; defaults to `Sheet1`
- **Match column** and **Match value** — The column header to search and the value to find. Matching ignores case
- **Values** — A JSON map such as `{"Name": "{{triggerPayload.body}}", "Status": "new"}`

What each step returns in `{{integrationResult}}`:

| Step | Useful results |
|------|----------------|
| **Look up row** | `found`, `rowNumber`, and `row` with each cell by column header — for example `{{integrationResult.row.Email}}` |
| **Update row**, **Delete row** | `matched`, `rowNumber` |
| **Upsert row** | `matched`, plus `updated` or `appended` |
| **Increment cell** | `previous` and the new `value` |
| **Create spreadsheet** | `spreadsheetId`, `url`, `sheetTab` |

## What data is sent to Google

- When saving from the inbox: the message's send time and its `Key : Value` pairs. Nothing else from the conversation is sent
- From automations: exactly the values you put in the step's fields

Each save is recorded in Qwetty (message, spreadsheet, tab and row number) so the inbox can show the **Saved** badge and the details window can list **Recent saves**.

## Troubleshooting

| Problem | What to do |
|---------|------------|
| **Save to Google Sheet** is missing from the menu | The message has no `Key : Value` line, the connection is not **Active**, or your role lacks **Edit** for Integrations |
| **Could not open the Google file picker. Try again.** | Allow popups for Qwetty and try again. If it keeps failing, reconnect the integration |
| The step fails on a spreadsheet you created yourself in Google | Qwetty can only open spreadsheets it created or that you picked in the picker. Pick the file once from the inbox dialog with **Use existing**, or create it with **Create spreadsheet** |
| A save or step fails after working before | Access may have been revoked in the Google account. Click **Reconnect** and approve access again |
| **Reconnect required** | Click **Reconnect** in the details window or the save dialog |

## Next steps

- [Google Drive](/en/integrations/google-drive) — Save attachments to Drive
- [Integrations Overview](/en/integrations/overview) — Connecting, statuses and permissions
- [Building Workflows](/en/automations/building-workflows) — Add integration steps to an automation
- [Message Actions](/en/inbox/message-actions) — Everything you can do with a single message
