2024-06-07 11:53:24 +00:00
|
|
|
---
|
|
|
|
sidebar_position: 3
|
|
|
|
---
|
|
|
|
|
2024-06-08 13:46:25 +03:00
|
|
|
# Copy sheet
|
2024-06-07 21:40:04 +00:00
|
|
|
Copies a sheet from one spreadsheet to another
|
2024-06-07 11:53:24 +00:00
|
|
|
|
|
|
|
|
2024-07-10 11:59:55 +03:00
|
|
|
|
2024-07-10 13:58:29 +03:00
|
|
|
`Function CopySheet(Val Token, Val From, Val Target, Val Sheet) Export`
|
2024-06-07 11:53:24 +00:00
|
|
|
|
2024-08-13 15:52:26 +03:00
|
|
|
| Parameter | CLI option | Type | Description |
|
|
|
|
|-|-|-|-|
|
|
|
|
| Token | --token | String | Token |
|
|
|
|
| From | --from | String | Source spreadsheet ID |
|
|
|
|
| Target | --to | String | Destination spreadsheet ID |
|
|
|
|
| Sheet | --sheet | String | CopiedSheetID |
|
2024-06-07 11:53:24 +00:00
|
|
|
|
2024-08-13 15:52:26 +03:00
|
|
|
|
|
|
|
Returns: Map Of KeyAndValue - serialized JSON response from Google
|
2024-06-07 11:53:24 +00:00
|
|
|
|
2024-07-10 14:05:58 +03:00
|
|
|
<br/>
|
2024-07-10 11:59:55 +03:00
|
|
|
|
2024-07-10 13:58:29 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-07 11:53:24 +00:00
|
|
|
```bsl title="Code example"
|
2024-09-29 19:41:20 +03:00
|
|
|
Token = "ya29.a0AcM612xw6IRwwkQIOEhizd2pJ6LLI4UAhdhxmXDGEzYkcfUPrLYgDDwbsSi5iQdc78WPs_1_Qor5KipuV6mAIvr6z-AKzrBaMT4erIR5T...";
|
|
|
|
From = "1IIUxPvgvrPCB92SXFISbKBFLAbmbHUIu_OysyC9w3Ow";
|
|
|
|
Target = "1p_TOtMYpcf_KGyUs2W44df1vAL-faoQnqW02GiT4qlA";
|
|
|
|
Sheet = "1572277025";
|
2024-09-29 00:25:48 +03:00
|
|
|
|
|
|
|
Result = OPI_GoogleSheets.CopySheet(Token, From, Target, Sheet);
|
2024-06-07 11:53:24 +00:00
|
|
|
```
|
2024-08-13 15:52:26 +03:00
|
|
|
|
2024-07-10 11:59:55 +03:00
|
|
|
|
2024-06-07 11:53:24 +00:00
|
|
|
|
|
|
|
```sh title="CLI command example"
|
2024-08-13 15:52:26 +03:00
|
|
|
|
|
|
|
oint gsheets CopySheet --token %token% --from "1Pu07Y5UiGVfW4fqfP7tcSQtdSX_2wdm2Ih23zlxJJwc" --to "1tPDQHmduH9NASRhy0I-a6--ebNNJ5A6wXhhTRcNhD7s" --sheet "25093199"
|
2024-06-07 11:53:24 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
```json title="Result"
|
2024-09-29 21:40:58 +03:00
|
|
|
{
|
|
|
|
"sheetId": 1468201785,
|
|
|
|
"title": "Sheet1 (копия)",
|
|
|
|
"index": 2,
|
|
|
|
"sheetType": "GRID",
|
|
|
|
"gridProperties": {
|
|
|
|
"rowCount": 1000,
|
|
|
|
"columnCount": 26
|
|
|
|
}
|
|
|
|
}
|
2024-06-07 11:53:24 +00:00
|
|
|
```
|