Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

185
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!