Transforming arrays into an array
Options
Dmytro
Member ✭
Hi there!
I have [ [{a}], [{b}], [{c}] ]
I need [ {a}, {b}, {c} ]
Any ideas?
Thanks!
Best Answer
-
Assuming a value x that contains [[{a}], [{b}], [{c}]]:
create value output = [] (empty array)
For each x as item
add to end of array - array: x value: item.0 (this will extract the first item in the array, turning [{a}] into {a})
stop and debug value:output
That should confirm output contains the shape you are looking for!
If you are facing more of this class of issue, data transform questions are a pretty common topic in our daily State Change Pro office hours. We get people over them pretty quickly!
Answers
-
Done.
Much appreciated, Ray!
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