Copy sheet
Copies a sheet from one spreadsheet to another
Function CopySheet(Val Token, Val From, Val Target, Val Sheet) Export
Parameter | CLI option | Type | Required | Description |
---|---|---|---|---|
Token | --token | String | ✔ | Token |
From | --from | String | ✔ | Source spreadsheet ID |
Target | --to | String | ✔ | Destination spreadsheet ID |
Sheet | --sheet | String | ✔ | CopiedSheetID |
Returns: Map Of KeyAndValue - serialized JSON response from Google
1C:Enterprise/OneScript code example
Token = "ya29.a0AXeO80Qz2NkSHo3Esq-3Dkvxlvhh01u6oDPv7m6vJvN5MUeluZlh2FsDbmMjoXx3N_bStbQrfvky5LWOPkgGfh8kmAQnvGb4Tc84o0wzy...";
From = "1e0x_xfBZnRHoqpvjiy5r-H9Cw5nWk8HdrXv3BXc2JKQ";
Target = "1XTWhcfDPKJgyDMTiShQJ-xuULIgiGjE9YFh-lfg0Jgc";
Sheet = "632051794";
Result = OPI_GoogleSheets.CopySheet(Token, From, Target, Sheet);
- Bash
- CMD/Bat
oint gsheets CopySheet \
--token "***" \
--from "11j0SRA1zZA0R2sRGqgk68o-CKb0NnilKHeSo7qp457w" \
--to "1TBbldl4-6cG8yhibhvB2HV6_ZrxqlLE6UOnTpW0Ibyc" \
--sheet "1052885583"
oint gsheets CopySheet ^
--token "***" ^
--from "11j0SRA1zZA0R2sRGqgk68o-CKb0NnilKHeSo7qp457w" ^
--to "1TBbldl4-6cG8yhibhvB2HV6_ZrxqlLE6UOnTpW0Ibyc" ^
--sheet "1052885583"
Result
{
"sheetId": 1272386935,
"title": "Sheet1 (копия)",
"index": 2,
"sheetType": "GRID",
"gridProperties": {
"rowCount": 1000,
"columnCount": 26
}
}