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

182
Vistas
Cleaned nodejs SQL Server query result content shown as undefined

When I try to clean the result of my query and output it in console it returns "undefined" for both the value tag and the options content. I know I am using the correct column names for this. I am using the nodejs mssql package for this. Any idea on why this is happening and how to fix it?

querymodule

const query = () =>{
    var output =``
    sql.connect(config).then(pool => {
        // Query
        
        return pool.request()
            .query('SELECT Pdf_Filename, SKU FROM RDCProductLabels WHERE PDF_Filename is not null Order by SKU')
    }).then(result => {
        for(data in result){
            output +=`
                        <option value="${data.PDF_Filename}">
                            ${data.SKU}
                        </option>
                     `
        }

        console.log(output)
        
    }).catch(err => {
       console.log(`an error occurred - ${err}`)
    });
}

generated html

  <option value="undefined">
      undefined
  </option>

  <option value="undefined">
      undefined
  </option>

  <option value="undefined">
      undefined
  </option>

  <option value="undefined">
      undefined
  </option>

  <option value="undefined">
      undefined
  </option>                       
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