1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2026-05-22 10:05:29 +02:00
Files
OpenIntegrations/docs/en/md/Google_Sheets/Data-managment/Set-cell-values.md
T
Vitaly the Alpaca (bot) cac41ea00b Main build (Jenkins)
2024-10-12 18:42:55 +03:00

3.3 KiB

sidebar_position
sidebar_position
1

Set cell values

Sets sheet cell values

Function SetCellValues(Val Token, Val Spreadsheet, Val ValueMapping, Val Sheet = "", Val MajorDimension = "COLUMNS") Export

Parameter CLI option Type Description
Token --token String Token
Spreadsheet --spreadsheet String SpreadsheetID
ValueMapping --data Map Of KeyAndValue Fill data where the key is the cell name like A1
Sheet --sheetname String Sheet name (first sheet by default)
MajorDimension --dim String Main dimension when filling the array range

Returns: Map Of KeyAndValue - serialized JSON response from Google


    Token       = "ya29.a0AcM612yqBU-Js-ZwvMX9kOgTqr1bzVlotSXxpjuDiy-VQFNrbVcJqWC-p_l2W_Ng_se_7j6PbCOWHu1waCLQEAilKYg3xb2Q18DG_cMfA...";
    Spreadsheet = "1MxBM0eQ7Vr74F5KqaeAQspPH3oViXUHbl3kDa451cdA";
    Sheet       = "Sheet2";

    ValueMapping = New Map;
    ValueMapping.Insert("A1", "ThisIsA1");
    ValueMapping.Insert("A2", "ThisIsA2");
    ValueMapping.Insert("B2", "ThisIsB2");
    ValueMapping.Insert("B3", "ThisIsB3");
    ValueMapping.Insert("A3", "ThisIsA3");
    ValueMapping.Insert("A4", "ThisIsA4");
    ValueMapping.Insert("B1", "ThisIsB1");
    ValueMapping.Insert("B4", "ThisIsB4");

    Result = OPI_GoogleSheets.SetCellValues(Token, Spreadsheet, ValueMapping, Sheet);
    
  oint gsheets SetCellValues --token %token% --spreadsheet "1Pu07Y5UiGVfW4fqfP7tcSQtdSX_2wdm2Ih23zlxJJwc" --data %data% --sheetname "Sheet2" --dim %dim%

{
 "spreadsheetId": "1p_i-5lmOKdBEbi88O0SkXq2Q_gG0c4EY7N_wtWGKSCs",
 "totalUpdatedRows": 4,
 "totalUpdatedColumns": 2,
 "totalUpdatedCells": 8,
 "totalUpdatedSheets": 1,
 "responses": [
  {
   "spreadsheetId": "1p_i-5lmOKdBEbi88O0SkXq2Q_gG0c4EY7N_wtWGKSCs",
   "updatedRange": "Sheet2!A1",
   "updatedRows": 1,
   "updatedColumns": 1,
   "updatedCells": 1
  },
  {
   "spreadsheetId": "1p_i-5lmOKdBEbi88O0SkXq2Q_gG0c4EY7N_wtWGKSCs",
   "updatedRange": "Sheet2!A2",
   "updatedRows": 1,
   "updatedColumns": 1,
   "updatedCells": 1
  },
  {
   "spreadsheetId": "1p_i-5lmOKdBEbi88O0SkXq2Q_gG0c4EY7N_wtWGKSCs",
   "updatedRange": "Sheet2!B2",
   "updatedRows": 1,
   "updatedColumns": 1,
   "updatedCells": 1
  },
  {
   "spreadsheetId": "1p_i-5lmOKdBEbi88O0SkXq2Q_gG0c4EY7N_wtWGKSCs",
   "updatedRange": "Sheet2!B3",
   "updatedRows": 1,
   "updatedColumns": 1,
   "updatedCells": 1
  },
  {
   "spreadsheetId": "1p_i-5lmOKdBEbi88O0SkXq2Q_gG0c4EY7N_wtWGKSCs",
   "updatedRange": "Sheet2!A3",
   "updatedRows": 1,
   "updatedColumns": 1,
   "updatedCells": 1
  },
  {
   "spreadsheetId": "1p_i-5lmOKdBEbi88O0SkXq2Q_gG0c4EY7N_wtWGKSCs",
   "updatedRange": "Sheet2!A4",
   "updatedRows": 1,
   "updatedColumns": 1,
   "updatedCells": 1
  },
  {
   "spreadsheetId": "1p_i-5lmOKdBEbi88O0SkXq2Q_gG0c4EY7N_wtWGKSCs",
   "updatedRange": "Sheet2!B1",
   "updatedRows": 1,
   "updatedColumns": 1,
   "updatedCells": 1
  },
  {
   "spreadsheetId": "1p_i-5lmOKdBEbi88O0SkXq2Q_gG0c4EY7N_wtWGKSCs",
   "updatedRange": "Sheet2!B4",
   "updatedRows": 1,
   "updatedColumns": 1,
   "updatedCells": 1
  }
 ]
}