Answer the question
In order to leave comments, you need to log in
How to update second sheet in google sheets api?
I am using google sheets api to work with google sheets and I need to change the second sheet.
Here I add rows to the sheet, which is the default
public function addRows ($values, $range = 'A1')
{
$body = new Google_Service_Sheets_ValueRange(['values' => $values]);
$opts = ['valueInputOption' => 'USER_ENTERED'];
return $this->service->spreadsheets_values->update($this->doc_id, $range, $body, $opts);
}
Answer the question
In order to leave comments, you need to log in
It is necessary to refer to the desired range, nanprmier, as @ProgrammerForever wrote.
A feature of the API is that without specifying the sheet name, it is assumed that the work is done with the first sheet by index. In interfaces, this sheet is the same as the first tab.
$range = 'Лист2!A1'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question