How do I show the .data._ output of two or more REST queries using expressions in a Table's "Data" field

Hi .. I am a new user to this great tool. I am trying to show the (.data._) output of two or more REST queries using expressions in a Table's "Data" field. I am trying to show the result of the query that finishes 1st followed by the 2nd & 3rd, etc. The output fields of all the queries are an exact match with a difference in the captured values. Using the "&&" only shows the output of the 2nd query (see attached screen capture).
Thks & Rgds

1 Like

Hi @majeed9001! In Javascript (which is what Retool accepts in between double curly brackets), the && operator actually evaluates truthiness, rather than combine multiple objects together (which is sounds like you're trying to do with your query).

Here's a quick example of how && might work:

For your use case, you might want to use something more like Object.assign, which essentially smooshes two objects together.

As a note, Object.assign will include all columns whether or not your queries have the same columns or different columns (e.g. query5 has id, name and query6 has object_id, price). Let me know how this works for you!

Hi victoria and thank you for your prompt reply. The Object.assign
returns the 2nd query value only (see attached). What am I doing wrong?

Here is another screen shot showing

the content of the data.

Ah! So you have the same columns/keys in both objects, you just want to combine the values?

If so, then something like this should work for you:


This converts each object into an object of arrays and them combines them all! Let me know how this goes for you :crossed_fingers:

Thank you victoria. The following worked for me:

Kind Regards,

Excellent! Glad to hear it worked for you :star_struck: Let us know if you have any other questions!