Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Skipping a value insertion on Google Sheets PHP

$valueRange = new Google_Service_Sheets_ValueRange();

// You need to specify the values you insert
$valueRange->setValues(["values" => ["$now", "SKIP", "SKIP", "SKIP", "$quantity", "SKIP", "SKIP"]]); // Add two values

// Then you need to add some configuration
$conf = ["valueInputOption" => "USER_ENTERED"];

// Update the spreadsheet
$service->spreadsheets_values->append($spreadsheetId, $range, $valueRange, $conf);

I only want to update specific columns in the row I am editing, how do I skip the ones that I don't want it to touch?

Where I have put "SKIP" I want it to completely ignore that column and keep whatever information is already in it

like image 645
Jk135 Avatar asked Jun 04 '26 14:06

Jk135


1 Answers

According to this issue using Google_Model::NULL_VALUE where the column value should be skipped solves the problem.

like image 54
Lyuboslav Alexandrov Avatar answered Jun 08 '26 01:06

Lyuboslav Alexandrov