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

78
Views
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 answers
Answer question

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 Report
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!