Googlesheet api php - filter query

2019-04-16 06:27发布

问题:

I would like to get filtered data from a google spreadsheet. For example if I have a column Name with values John, David, John => I would like to be able to get all the rows that have the Name = John.

$range = 'Sheet1!A2:A4';
$response = $service->spreadsheets_values->get($spreadsheetId, $range);
$values = $response->getValues();

This gets me all the values within the range. I don't know how can I add a filter depending on the Name value.

Any help appreciated