Category : google-sheets

We’re updating an existing form so we can also add data to a Google sheet. I’m trying to follow the tutorial at Srijan.net. We’ve got the spreadsheet built, Composer is handling the dependencies, we’ve got the project created and enabled, got the credentials.json file created and loaded and a test page running. However, when we ..

Read more

$data = []; array_push( $data, new Google_Service_Sheets_ValueRange([ ‘range’ => $year.’!’. self::GOOGLECOL_PRICE_COLUMN . $e[‘rowIndex’], ‘values’ => [[number_format((double) $data[‘price’], 0, ‘.’, ‘ ‘)]] ]) ); array_push( $data, new Google_Service_Sheets_ValueRange([ ‘range’ => $year.’!’. self::GOOGLECOL_PRICETWO_COLUMN. $e[‘rowIndex’], ‘values’ => [[number_format((double) $data[‘price_two’], 0, ‘.’, ‘ ‘)]] ]) ); array_push( $data, new Google_Service_Sheets_ValueRange([ ‘range’ => $year.’!’. self::GOOGLECOL_PRICETHREE_COLUMN . $e[‘rowIndex’], ‘values’ => [[number_format((double) ..

Read more

$range1 = new Google_Service_Sheets_GridRange(); $range1->setStartRowIndex(92); $range1->setEndRowIndex(92); $range1->setStartColumnIndex(4); $range1->setEndColumnIndex(4); $range1->setSheetId(1433074761); $range2 = new Google_Service_Sheets_GridRange(); $range2->setStartRowIndex(92); $range2->setEndRowIndex(92); $range2->setStartColumnIndex(2); $range2->setEndColumnIndex(2); $range2->setSheetId(1433074761); $request1 = new Google_Service_Sheets_UpdateCellsRequest(); $request1->setFields(‘aaaaaaaaaaaaaaaaaaaaaaaaaaaa’); $request1->setRange($range1); $body1 = new Google_Service_Sheets_Request(); $body1->setUpdateCells($request1); $request2 = new Google_Service_Sheets_UpdateCellsRequest(); $request2->setFields(‘aaaaaaaaaaaaaaaaaaaaaaaaaaa’); $request2->setRange($range2); $body2 = new Google_Service_Sheets_Request(); $body2->setUpdateCells($request2); $batchUpdateRequest = new Google_Service_Sheets_BatchUpdateSpreadsheetRequest(); $batchUpdateRequest->setRequests([$body1, $body2]); So I was able to fix an error I ..

Read more

$range1 = new Google_Service_Sheets_GridRange(); $range1->setStartRowIndex(1); $range1->setEndRowIndex(1); $range1->setStartColumnIndex(92); $range1->setEndColumnIndex(92); $range2 = new Google_Service_Sheets_GridRange(); $range2->setStartRowIndex(5); $range2->setEndRowIndex(5); $range2->setStartColumnIndex(92); $range2->setEndColumnIndex(92); $request1 = new Google_Service_Sheets_UpdateCellsRequest(); $request1->setFields(‘BATCHUPDATE’); $request1->setRange($range1); $body1 = new Google_Service_Sheets_Request(); $body1->setUpdateCells($request1); $request2 = new Google_Service_Sheets_UpdateCellsRequest(); $request2->setFields(‘BATCHUPDATE2’); $request2->setRange($range2); $body2 = new Google_Service_Sheets_Request(); $body2->setUpdateCells($request2); $batchUpdateRequest = new Google_Service_Sheets_BatchUpdateSpreadsheetRequest(); $batchUpdateRequest->setRequests([$body1, $body2]); The documentation is confusing, because I tried to do several ways, ..

Read more