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

83
Visualizações
Adding an element to JSON returned from a map loop with a final Promise.all

I'm using Retool and looking up records in a Firestore table by a Document ID.

The below code works great and returns an array of JSON objects. However it does not have the appIDs[?] used in the lookup. How can I add the appIDs ('id1','id3', or 'id2') as an additional element to the matching JSON object in the array? The order of the returned array of JSON objects is not necessarily the same order as the appIDs array.

var appIDs = ['id1','id3','id2'];

var metadatas = appIDs.map(row => {
  return qTile_description_v1.trigger({
    additionalScope: {
      appID: row
    }
  });
});

return Promise.all(metadatas.map(p => p.catch(error => null)));
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Answer in comments. Apparently the answer is easy since my statement that the order returned may not be the same as the order of the keys in the array is false. The order will be the same, so problem solved.

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