Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

google-sheets api not triggering onEdit function in google sheets

I'm using php to write data into google sheets. However, the trigger onEdit function on google sheets isn't firing when the data is written from the php. Here's the piece of code I used to write down the data:

$body = new Google_Service_Sheets_ValueRange(array('values' => $resultArrayGen));
$params = array('valueInputOption' => $valueInputOption);
$range = 'Main!F2:K';
$result = $service->spreadsheets_values->update($spreadsheetId, $range, $body, $params);

Is there anyway to use google services sheets api to trigger the onEdit function in google spreadsheets?

Thanks

like image 466
Poom Poom Avatar asked Oct 18 '22 07:10

Poom Poom


1 Answers

The onEdit trigger wont fire according to Google's documentation:

Script executions and API requests do not cause triggers to run. For example, calling Range.setValue() to edit a cell does not cause the spreadsheet's onEdit trigger to run.

You can find it here.

like image 125
async3 Avatar answered Oct 21 '22 01:10

async3