1
votes

Hi I would like to know how to include conditions in a Google Api v4 sheets query.

e.g. where B = 'News

Do I include the condition in the range or as an additional request parameter?

I am currently using

GET https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values:batchGet

and

POST https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values:batchUpdate

1

1 Answers

0
votes

I think there's no ready-made query() function in Sheets v4. What you can do is fetch the values of a given range in sheets using spreadsheets.values.get then loop over the values and compare. Sample is found in Basic Reading in Sheetsv4.

Aside from that try this vlookup method. However, it uses Apps Script.