help for complex merging of objects
Options
![Geoffroy](https://us.v-cdn.net/6037124/user_avatars/4712881.jpg)
Geoffroy
Member ✭
I get from an api some json that I put together in a array:[screenshot-xlsr-vkx0-tgvl.f2.xano.io-2022.06.25-22_56_30.png]
I need to perform calculations with a loop on the dates. I need to transform these arrays so that the keys are the dates in order to loop on them.
I'm having trouble doing this and wonder if it's possible.
The expected result would look like this:
2020-01-01:[
{IE854163975 : { weight: 0.3,
open: 19,
close: 20
},
},
{IE854136742 : { weight: 0.3,
open: 19,
close: 20
},
},
{IE854136742 : { weight: 0.3,
open: 19,
close: 20
},
},
]
2020-01-08:[
{IE854163975 : { weight: 0.3,
open: 19,
close: 20
},
},
{IE854136742 : { weight: 0.3,
open: 19,
close: 20
},
},
{IE854136742 : { weight: 0.3,
open: 19,
close: 20
},
},
]
Does anyone have any suggestions on how to merge these arrays in the fastest and most efficient way possible?
I need to perform calculations with a loop on the dates. I need to transform these arrays so that the keys are the dates in order to loop on them.
I'm having trouble doing this and wonder if it's possible.
The expected result would look like this:
2020-01-01:[
{IE854163975 : { weight: 0.3,
open: 19,
close: 20
},
},
{IE854136742 : { weight: 0.3,
open: 19,
close: 20
},
},
{IE854136742 : { weight: 0.3,
open: 19,
close: 20
},
},
]
2020-01-08:[
{IE854163975 : { weight: 0.3,
open: 19,
close: 20
},
},
{IE854136742 : { weight: 0.3,
open: 19,
close: 20
},
},
{IE854136742 : { weight: 0.3,
open: 19,
close: 20
},
},
]
Does anyone have any suggestions on how to merge these arrays in the fastest and most efficient way possible?
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback