Skip to main content

Copy sheet

Copies a sheet from one spreadsheet to another

Function CopySheet(Val Token, Val From, Val Target, Val Sheet) Export

ParameterCLI optionTypeRequiredDescription
Token--tokenStringToken
From--fromStringSource spreadsheet ID
Target--toStringDestination spreadsheet ID
Sheet--sheetStringCopiedSheetID

Returns: Map Of KeyAndValue - serialized JSON response from Google


1C:Enterprise/OneScript code example
    Token  = "ya29.a0AQQ_BDTgQbn9c5rXhPK3FCakms_7oKkdIWE1CCQFnSPftb2RxvloVqnYOcnsAKhXrD0Gq8Tz2Kgn5IBXG5E25uksZfvvTtXob-jFcuj_9LZYs9La4HrcFk766...";
From = "16uPAewX6jwjTdyVlE0O8adQngnoCMbUHQ5Ek36-IPaQ";
Target = "1yQLBzhkpVUAyba_xUaq-WCxnWugZuXmcSdPUvoLZyn0";
Sheet = "1708127749";

Result = OPI_GoogleSheets.CopySheet(Token, From, Target, Sheet);
    oint gsheets CopySheet \
--token "***" \
--from "1B6z_e-dcUabYF4ZB0GyymzS_-Xzguwq7NPbLpFq0jdA" \
--to "1pQtYIB2uPzzjo3LM8vlRqH0sf8ERH-RYKAEw4gHy8iQ" \
--sheet "1878797825"
Result
{
"sheetId": 210732592,
"title": "Sheet1 (копия)",
"index": 2,
"sheetType": "GRID",
"gridProperties": {
"rowCount": 1000,
"columnCount": 26
}
}