0

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 Answer 1

0
  const colIndex = 9; // Column J
  data.forEach(function(f) {
    if (f[colIndex] == searchtext) {
      ar.push(f);
    }
  });
Sign up to request clarification or add additional context in comments.

4 Comments

When i change it to this, it only returns column J. I need it to return column A:N, but only search column J.
Updated. Please check
Thanks, it works perfect. :) Would you happen to know if its possible to sum up column N and display it below or something? In column N each row has a $$ value.
What do you mean by 'display it below' and a '$$' value? Please create a new question and elaborate.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.