Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

228
Vistas
string search in app script is not working

I am having one google sheet (sheet1) of supplier details. The column names are CODE, SUPP, PLACE with rows of around 300 plus. When I want to search the supplier name having "IMPEX", I am using following google sheet query formula:

=QUERY(Sheet1!A1:C200, "SELECT A, B, C WHERE B CONTAINS '%IMPEX%' ",1)

the Google sheet query is fetching the details. And the results comes as following, which is fine.

CODE    SUPP                         PLACE
1138    IMPEX STEELS PVT LTD         BANGALORE
1278    SHIVAM IMPEX LTD             BANGALORE
1345    IMPEX INC,                   CHENNAI
1456    RADHE STEEL IMPEX            MUMBAI

Now I want to use this in Google Apps Script. I wrote the following code but it is not working. Could someone edit or rectify it?

function searchName{

  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var ws = ss.getSheetByName("Sheet1");/
  var dr = ws.getRange("A1:C360"); 
  var data = dr.getValues(); 

  //show the search results in the same sheet on D15 cells
  Var D15 = ws.getRange("D15:F20")

  var result = [];

   for (var i =0; i< data.length; i++){
         if(data[i][1] = "IMPEX"){        
          result.push(data[i]);

         // Logger.log(result)
         d15.displayRow(result);
          
          }
    }
}
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda