Extracting objects from an object array of specific indices
Options
![Prathyusha Chilagani](https://us.v-cdn.net/6037124/user_avatars/2712923.jpg)
Prathyusha Chilagani
Member ✭
I have an array of numbers, say A. I have a different object array B and want to filter objects of only those indices which are the elements of A.
I am trying to use for loop :
for each "item" of A,
Add to C (New variable which is type Array), those elements of B whose index = item
I am unable to get this right.
Can you help me with the syntax. I do not know how to pass "item" in the path
[image.png]I do not know if I am even doing this right. If you could let me know there's a better method, that would be greatly helpful
Thank you,
Prathyusha
I am trying to use for loop :
for each "item" of A,
Add to C (New variable which is type Array), those elements of B whose index = item
I am unable to get this right.
Can you help me with the syntax. I do not know how to pass "item" in the path
[image.png]I do not know if I am even doing this right. If you could let me know there's a better method, that would be greatly helpful
Thank you,
Prathyusha
Comments
-
I think you are looking for the "get" filter to fetch the array. So if I am reading the data structure in your screenshot correctly CurrentSessionDateSet.0.image (press filter) (select get) (path = item)
-
Hello Ray,
Thank you very much. That worked!
👍
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