Google sheet + Web app search specific column and return all matching rows

506 Views Asked by At

Anybody knows how can I amend the code below to only search from a specific column in Google sheet e.g. column J?

The code below works great and returns the entire row that matches the searchtext, but the search is across the entire range within the google sheet. https://www.bpwebs.com/create-web-forms-to-get-data-from-google-sheets/comment-page-1/#comments

1

There are 1 best solutions below

4
idfurw On BEST ANSWER
  const colIndex = 9; // Column J
  data.forEach(function(f) {
    if (f[colIndex] == searchtext) {
      ar.push(f);
    }
  });