Skip to main content

Add sheet

Adds a new sheet to the spreadsheet

Function AddSheet(Val Token, Val Spreadsheet, Val Name) Export

ParameterCLI optionTypeRequiredDescription
Token--tokenStringToken
Spreadsheet--spreadsheetStringSpreadsheet identifier
Name--titleStringNewSheetName

Returns: Map Of KeyAndValue - serialized JSON response from Google


1C:Enterprise/OneScript code example
    Token       = "ya29.a0AcM612wmWdggP-K6tOc3UqW0KxYMjUi60_Uhu-ERltTaavHGbML0nRBXqkuiBcr0GNmR_1gHKowaF1Rd_4Q5Amc9O23DEBZ95sNEGnpR5...";
Spreadsheet = "1fktk0k_rOszr4c3t89Z1KXXSsRWPU0fFPgLImiN-MzI";
Name = "TestSheet";

Result = OPI_GoogleSheets.AddSheet(Token, Spreadsheet, Name);
    oint gsheets AddSheet \
--token "***" \
--spreadsheet "1lNdwweEhK1C1fXq80MLl6-CWAj9y89EJYiUBziOrvhM" \
--title "TestSheet"
Result
{
"spreadsheetId": "1psqJkXdtlHOc7Qzr4ficNkFth5dWLl0HdmMDhSTM7ZQ",
"replies": [
{
"addSheet": {
"properties": {
"sheetId": 1019462179,
"title": "TestSheet",
"index": 2,
"sheetType": "GRID",
"gridProperties": {
"rowCount": 1000,
"columnCount": 26
}
}
}
}
]
}