# Google Sheets: Read and Write Data

> Connect Google Sheets, verify access by reading a known range, then add one test row and check the result before retrying.

Connect Google Sheets, read a small cell range to verify access, and append one new row. Test the read first: a saved connection does not prove resource access, and read access does not prove write access.

**At a glance**

- **Result:** Read known cells from Google Sheets, then add and verify one test row.
- **You need:** A Google account with access to a non-sensitive test spreadsheet and permission to edit it for the write test.
- **Usage:** Real runs use workspace credits and may incur charges from the connected service.
- **What changes:** The read retrieves data without changing cells. Add Single Row writes real data, even when the automation is in Draft; repeating it can create duplicate rows.

[Click to start](https://docs.getglow.ai/build/triggers/click-to-start) → Get Values in Range → Add Single Row

## Before You Start

- Open the Glow workspace where you will build the automation. Connections are workspace-specific.
- Choose a test spreadsheet and worksheet. Check that the intended Google account can open them and has permission to edit them for the write test.
- Put recognizable, non-sensitive values in a small range such as `A1:B3`. Keep the read test separate from any Steps that send messages, change records, or delete data.

## [1. Connect Google Sheets](https://docs.getglow.ai/getting-started/examples/google-sheets-read-write#practical-example-connecting-google-sheets)

1. Open **Connections** and click **Connect an app**.
2. Search for "Google Sheets" and select it.
3. Follow the connection form and sign in with the Google account that can access your spreadsheet.
4. Review the permissions shown by Google before approving them.
5. Complete Google's consent prompts and return to Glow.
6. Click the saved Google Sheets connection's tile under **Your connections**. In its details, check that **Connected as** identifies the intended account without **Needs reconnecting**.
7. In your automation, add a Google Sheets Step. Select your saved connection from the **Connection** dropdown.

If you already have the intended connection, select it rather than connecting again. For sign-in or account-selection help, see [Connecting an App](https://docs.getglow.ai/manage/apps-and-integrations/connecting-an-app).

![The Connect an app dialog in Glow Connections.](https://docs.getglow.ai/images/docs/workspace/connect-an-app.webp)
*Authorize your Google account under Connections, then select the saved connection on your Google Sheets Steps.*

## [2. Read a Small Range](https://docs.getglow.ai/getting-started/examples/google-sheets-read-write#reading-data-instead-of-writing-it)

The same connection can read and write, subject to the account's permissions. **Get Values in Range** retrieves rows already in a sheet; **Add Single Row** writes a new row.

1. Open **Apps**, search for **Google Sheets**, and pick **Get Values in Range**.
2. Choose your **Connection**, then the **Spreadsheet ID** and **Worksheet ID** (keeping **Mode** in the Step's `⋮` menu set to **HTTP** to configure fields manually).
3. For a first test, set **Range** to a small range of non-sensitive cells, such as `A1:B3`, containing values you can recognize.
4. Follow the test procedure below to run the read action. Inspect its **Executions** output before mapping returned fields into later Steps.

Reading first is what makes a "go through the rows and do something with each" automation possible: feed the output into a Step set to **Each item**, or into a [Repeater](https://docs.getglow.ai/build/action-steps/loops) if each row needs several Steps.

**Looking for a specific value** rather than a range? **Find Row** searches a column and returns matching row numbers and values. Enable **Export Row** if you need the full matching rows.

## [3. Test the Read](https://docs.getglow.ai/getting-started/examples/google-sheets-read-write#testing-a-connection)

### Prepare a small, separate test

Use a separate automation kept in **Draft**. Add a **Click to start** trigger followed by only the **Get Values in Range** action. Select the intended **Connection** and your test spreadsheet, worksheet, and range. Use concrete field values for this check, rather than values from earlier Steps.

### [Run the automation, not saved test data](https://docs.getglow.ai/getting-started/examples/google-sheets-read-write#run-the-workflow-not-saved-test-data)

Open the dropdown beside **Run** in the dock, select the trigger under **Manual run starting step**, and click **Run** once.

**Dock Run** (Verifies Live Access)

- Executes the connected Google Sheets action against your spreadsheet.
- Confirms your OAuth connection and sheet permissions work.

**Step Menu Run step** (Sample Replay Only)

- Replays saved test data on an ordinary app action.
- Does not call Google Sheets or verify account access.

### Check the result and continue

Open the app Step's **Executions** tab and inspect the output from this automation run. Compare it with the known values in your test sheet's `A1:B3` range. Success means it returned the expected data from the intended resource, not just a green status or an empty result.

If the read fails, use [connection troubleshooting](https://docs.getglow.ai/manage/apps-and-integrations/connecting-an-app#edge-cases-and-troubleshooting) before retrying. Recheck the account and destination before the write test below; a successful read does not prove permission to write.

## [4. Add One Row](https://docs.getglow.ai/getting-started/examples/google-sheets-read-write#from-connected-to-configured-one-full-action)

Carry the same Google Sheets connection through an **Add Single Row** Step after the read-only access check succeeds.

> **An automation run performs real work, even in Draft.** Use a test
> spreadsheet for this example: Add Single Row writes data. Executed work uses
> workspace credits and may incur charges from the connected service. Check the
> sheet before retrying a failed or timed-out write to avoid duplicate rows.

1. Open **Apps** in the dock, search for **Google Sheets**, and pick **Add Single Row**. It lands on the canvas; connect it after the Step whose data it should record.
2. Click the Step. Choose your **Connection**, or **Connect a new connection…** if none is connected yet (keeping **Mode** in the Step's `⋮` menu set to **HTTP**).
3. Select the test **Spreadsheet ID**, then the **Worksheet ID**. Check both selections before writing.
4. Enter the row's **Values** as a list in column order, for example `["connection test", 42]`. Leave the optional **Row Index** blank to append. Setting it inserts a row at that position and shifts existing rows down.
5. Review all Steps that the automation will run, then click **Run** in the dock once. Confirm in both **Executions** and your test spreadsheet that one new row contains `connection test` and `42` before repeating a run.

**Verify it works**

- **Run:** Select the Click to start trigger as the starting Step and click Run in the dock once.
- **You should see:** Get Values in Range returns your A1:B3 cells, and Add Single Row appends one new test row.

## What's Next?

- [Automation Data](https://docs.getglow.ai/build/core-concepts/workflow-data) explains how to use a Step's output in later Steps.
- [Testing & Debugging](https://docs.getglow.ai/build/the-canvas/testing-and-debugging) covers run points and inspecting results before retrying.
- [Managing Connections](https://docs.getglow.ai/manage/apps-and-integrations/managing-connections) covers reconnecting and checking dependent automations.
