# Upsert Apify Dataset into Google Sheets

**Use case:** 

Update matching rows in Google Sheets and append new ones using a single key column. Default key is id—change keyColumns to match your sheet. Change the key column(s) to match columns that actually exist in your source dataset. The defaults are examples only. Provide service-account JSON, spreadsheet, tab, and source dataset before running.

## Input

```json
{
  "operation": "dataset_to_sheet",
  "sheetName": "Sheet1",
  "writeMode": "upsert",
  "keyColumns": [
    "id"
  ],
  "headerRow": 1,
  "maxRows": 50000,
  "rowLimitAction": "fail",
  "batchSize": 2000,
  "autoCreateSheet": true,
  "valueInputOption": "RAW"
}
```

## Output

```json
{
  "recordType": {
    "label": "Record type",
    "format": "string"
  },
  "status": {
    "label": "Status",
    "format": "string"
  },
  "actorVersion": {
    "label": "Actor version",
    "format": "string"
  },
  "operation": {
    "label": "Operation",
    "format": "string"
  },
  "writeMode": {
    "label": "Write mode",
    "format": "string"
  },
  "sheetName": {
    "label": "Sheet name",
    "format": "string"
  },
  "rowsRead": {
    "label": "Rows read",
    "format": "integer"
  },
  "rowsTransferred": {
    "label": "Rows transferred",
    "format": "integer"
  },
  "rowsUpdated": {
    "label": "Rows updated",
    "format": "integer"
  },
  "rowsAppended": {
    "label": "Rows appended",
    "format": "integer"
  },
  "columns": {
    "label": "Column count",
    "format": "integer"
  },
  "keyColumns": {
    "label": "Key columns",
    "format": "array"
  },
  "errorCode": {
    "label": "Error code",
    "format": "string"
  },
  "message": {
    "label": "Message",
    "format": "string"
  }
}
```

## About this Actor

This example demonstrates how to use [Reliable Google Sheets Bridge](https://apify.com/groundedvisionmedia/reliable-sheets-bridge.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/groundedvisionmedia/reliable-sheets-bridge.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/groundedvisionmedia/reliable-sheets-bridge.md

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).
