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

186
Vistas
How to get a specific row by specific value from a google sheet via Express JS

I am working on a little project where I want to get a specific row from a specific Google sheet, by a specific value (last_name).

This is a Google sheet where I have a list of users.

I am using Express JS and the package googleapis for Node js.

Actually, this is the output I have with my API call.

[
    [
        "LASTNAME1",
        "FIRSTNAME1",
        "0100000000",
        "email@email1.com"
    ],
    [
        "LASTNAME2",
        "FIRSTNAME2",
        "0100000000",
        "email@email2.com"
    ],[
        "LASTNAME3",
        "FIRSTNAME3",
        "0100000000",
        "email@email3.com"
    ]
]

Actually I managed to sort the data like this but I don't know what to do next, can you help me?

[
  'LASTNAME1, email@email1.com',
  'LASTNAME2, email@email2.com',
  'LASTNAME3, email@email3.com'
]

This is my method :

const auth = new google.auth.GoogleAuth({
            keyFile: "keys.json",
            scopes: "https://www.googleapis.com/auth/spreadsheets",
        });
        const authClientObject = await auth.getClient();
        const googleSheetsInstance = google.sheets({ version: "v4", auth: authClientObject });
        const spreadsheetId = "idofmygooglesheet";
        const readData = await googleSheetsInstance.spreadsheets.values.get({
            auth,
            spreadsheetId,
            range: "B10:M",
        })
        const rows = readData.data.values!;
        let users: any[] = [];
        if (rows.length) {
            rows.map((row) => {
                users.push(`${row[0]}, ${row[3]}`);
            });
        } else {
            console.log('No user found with this name.');
        }
        console.log(users);
        res.status(httpStatus.OK).json(readData.data.values);

Thank you very much for your help !

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