Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

74
Visualizações
Displaying data from a JSON object

I am making a Node.js & Express app that gets records from a CRM. I'm trying to show the data on a html page by sending the data with:

    app.get('/user', (req, res) => {
    let stringify = JSON.stringify(responseObject);
    res.send(stringify);
    });

The response I get is:

{
    data: [
        {
            keyValues: {},
            keyModified: {}
        }
    ],
    info: {
        perPage: 200,
        count: 1,
        page: 1,
        moreRecords: false,
        keyModified: { }
    },
    keyModified: { }
}

I want to display only the data within the "keyValues" object, which contains the data of the user I'm searching for. How can I make this happen?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You have to extract from responseObject only the informations that you want to send. Since data is an array you can map on it and select only the keyModified attribute. Something like this:

app.get('/user', (req, res) => {
  res.json(responseObject.data.map(d => d.keyModified))
});

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda