JavaScript Google Script - Help in having setValue change every 10 matched rows google script help,google apps script help,google apps script

Building on my previous question relating to this script below. Is it possible to setValue to change after 10 matches, I would like to assign "found here" for the first 10 matches, then "something else" for another 10 matches, then "another phrase" for 10, and then critically to repeat. Thus every match is set a value that changes every 10 matched rows -

function onSearch() {
    var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Main Sheet");
    var searchVal1 = sheet.getRange("AE31").getValue();
    var searchVal2 = sheet.getRange("AE32").getValue();
    var searchVal3 = sheet.getRange("AE33").getValue();
    var searchCol1 = sheet.getRange(2,6,sheet.getLastRow()).getValues();
    var searchCol2 = sheet.getRange(2,7,sheet.getLastRow()).getValues();    
    var searchCol3 = sheet.getRange(2,7,sheet.getLastRow()).getValues(); 
    for (var i = 0, len = searchCol1.length; i < len; i++) 
    for (var i = 0, len = searchCol2.length; i < len; i++)

{if (searchVal1 === "")
      (searchCol2[i][0] == searchVal2)
       else if (searchCol1[i][0] == searchVal1)
{if (searchCol2[i][0] == searchVal2)
    {if (searchVal2 === "")
      (searchCol3[i][0] == searchVal3)
       else if (searchCol2[i][0] == searchVal2)
{if (searchVal3 === "")
      else if (searchCol3[i][0] == searchVal3) 

{sheet.getRange(i + 2, 30).setValue("found here")

This is an example of the data set i am using - https://docs.google.com/spreadsheets/d/1CAflyzAIyb5Fuz3Ef2sLbhfFO9DXSNIVIh0h7uBEFQo/edit?usp=sharing Any and all help would be great thank you.

Answer:1

I am having issues reading this data: It looks like this: { "ok": true, "messages": [ { "text": "moo", "username": "bot", "type": "message", "subtype": "bot_message",...

I am having issues reading this data: It looks like this: { "ok": true, "messages": [ { "text": "moo", "username": "bot", "type": "message", "subtype": "bot_message",...

I'm trying to work with a table in Javascript. I have a function to create an empty table, //This function will create an empty table of a length of vars+1 //This function will create the header ...

I'm trying to work with a table in Javascript. I have a function to create an empty table, //This function will create an empty table of a length of vars+1 //This function will create the header ...

  1. javascript uncaught typeerror cannot read property
  2. javascript uncaught typeerror is not a function
  3. javascript uncaught typeerror illegal invocation
  4. javascript uncaught typeerror is not a constructor
  5. javascript uncaught typeerror assignment to constant variable
  6. javascript uncaught typeerror object(...) is not a function

I have some text: <p>hello world. This is a test paragraph.</p> I want to add an <em> tag at start positions and </em> at end positions giving us: <p> <em>...

I have some text: <p>hello world. This is a test paragraph.</p> I want to add an <em> tag at start positions and </em> at end positions giving us: <p> <em>...

  1. jquery wrap javascript
  2. jquery wrap javascript object

I would like to search various columns in my sheet to find matches to certain cells. The issue comes from some of these cells may be blank and as they are I would like to skip it and do the next ...

I would like to search various columns in my sheet to find matches to certain cells. The issue comes from some of these cells may be blank and as they are I would like to skip it and do the next ...