> For the complete documentation index, see [llms.txt](https://docs.planetcrust.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.planetcrust.com/human-connections/google/google-sheets-individual/action-copy-worksheet.md).

# Action: Copy Worksheet

<p align="center"><a class="button primary" data-icon="circle-caret-right">Try @Human</a><a class="button primary" data-icon="check">Buy @Human Subscriptions</a><a class="button primary" data-icon="comments">Join @Human Community</a></p>

<figure><img src="/files/auAzkjCWGFak171PMqGd" alt=""><figcaption></figcaption></figure>

<p align="center">The Copy Worksheet action duplicates an entire worksheet within the same or another spreadsheet.</p>

{% embed url="<https://www.youtube.com/watch?v=CyuUuaBSZzA>" %}

#### Example User Story

I want to copy a worksheet within a Google Sheet so that I can create a duplicate with a new name.

#### Fields

| Field Name    | Field Type | Required |
| ------------- | ---------- | -------- |
| spreadsheetId | String     | Yes      |
| sheetId       | Integer    | Yes      |
| newSheetName  | String     | Yes      |

### Related Connections

[Google Sheets](/human-connections/google/google-sheets-individual.md)

### Related Automations

Example link

### Code (Apache v2.0): Operation

```
{
  "handle": "copy-worksheet",
  "state": "inDev",
  "meta": {
    "short": "Copy Worksheet",
    "description": "Copies a worksheet within a Google Sheet to a new worksheet."
  },
  "input": [
    {
      "name": "spreadsheetId",
      "type": "String",
      "required": true,
      "meta": {
        "description": "The spreadsheet to copy the sheet within."
      }
    },
    {
      "name": "sheetId",
      "type": "Integer",
      "required": true,
      "meta": {
        "description": "The ID of the worksheet to copy."
      }
    },
    {
      "name": "newSheetName",
      "type": "String",
      "required": true,
      "meta": {
        "description": "The name of the new worksheet."
      }
    }
  ],
  "output": [
    {
      "name": "newSheetId",
      "type": "Integer",
      "selector": [
        "body",
        "sheetId"
      ],
      "meta": {
        "description": "The ID of the newly created worksheet."
      }
    }
  ],
  "steps": [
    {
      "type": "http",
      "http": {
        "method": "POST",
        "path": {
          "value": "{{spreadsheetId}}:batchUpdate"
        },
        "headers": {
          "Content-Type": {
            "value": "application/json"
          }
        },
        "bodyTemplate": {
          "value": "{\"requests\": [{\"duplicateSheet\": {\"sourceSheetId\": {{sheetId}}, \"newSheetName\": \"{{newSheetName}}\"}}]}",
          "placeholders": [
            {
              "name": "sheetId",
              "type": "Integer",
              "description": "The ID of the worksheet to copy.",
              "required": true,
              "default": ""
            },
            {
              "name": "newSheetName",
              "type": "String",
              "description": "The name of the new worksheet.",
              "required": true,
              "default": ""
            }
          ]
        }
      }
    }
  ]
}
```

<p align="center"><a class="button primary" data-icon="square-caret-right">Try @Human</a><a class="button primary" data-icon="check">Buy @Human Subscription</a><a class="button primary" data-icon="comments">Join @Human Community</a></p>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.planetcrust.com/human-connections/google/google-sheets-individual/action-copy-worksheet.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
