Best Method to Combine 2 data values from 2 different Queries and 2 components into an array

Thank you in advance for viewing and for your help replies! Just so you know I've haven't done anything with website for over 18 years, and I just started working in retool a couple of days ago. I apologize, if my replies are slow. I'm trying to get any extra details that will help. I've been spinning my wheels on this one trying to figure out a method, the best method. I could use a little push in the right direction. Or maybe, a big one?

  • Goal:
  1. I'm trying to combine arrays or objects in object format; to then, be passed as a single array.
  2. I'm trying to GET
    ({{apiRestQuery1.data.data['0'].id1}}),
    ({{apiRestQuery1.data.data['0'].id2}}),
    ({{apiRestQuery2.data.data['0'].id1}}),
    ({{apiRestQuery2.data.data['0'].id2}}),
    {{componentdate1.value}},
    {{componentdate2.value}}
  • Steps:
    So far I've tried:
  1. combining two queries
  2. a queryJS that's formatted and sorted
  • Details:

  • Screenshots:


2.

This will be tough to assist as there is not enough information...
Is the data strictly limited to the following:
{{apiRestQuery1.data.data['0'].id1}},
{{apiRestQuery1.data.data['0'].id2}},
{{apiRestQuery2.data.data['0'].id1}},
{{apiRestQuery2.data.data['0'].id2}},
{{componentdate1.value}},
{{componentdate2.value}}

data.data doesn't look correct but if it is, what are the values?
If this is all the data you need then you could do the following in a js query:

return [

{{apiRestQuery1.data.data['0'].id1}},
{{apiRestQuery1.data.data['0'].id2}},
{{apiRestQuery2.data.data['0'].id1}},
{{apiRestQuery2.data.data['0'].id2}},
{{componentdate1.value}},
{{componentdate2.value}}

]

1 Like

When I mouse over {{.data.data['0']}} it gives me string paths.
I'm going to try right now!

is that already in an array or do I need to formatDataAsObject ?

And you were right. There's not supposed to be {{}} for JS query. I'm thinking since it responds as a column its an array. yes or no? It is I ran it.

THANK YOU!!!

How can I change the arrayId as the string label? My array changed to 0(id1):value
1(id2):value
2(id1):value
3(id2):value
...
...

Hi there,

Happy to help out here!

To get a better understanding of what you want to change, could you please send me a screenshot of the new array that you get? Could you then also let me know how you want it to look instead?

Looking forward to your reply.

Best,
Evan