Keep getting a 'Please use a numerically indexed array' message in debugger
![Vadim Vozmitsel](https://us.v-cdn.net/6037124/uploads/userpics/EXTXEORR8AQQ/n4EY6QV5MZ5N0.jpg)
Hi @Michael Udinski,
I am adding data from an external API and have run into the 'Please use a numerically indexed array' issue in the debugger.
I have reviewed the 4 threads on this topic here but still am not able to chase down where the issue is as the debugger does not actually reveal the exact location. I've also followed your video on the REST Countries API and have that call up and running successfully. So I modelled this call after that one but something weird keeps happening.
I first tried using the Values filter on the whole variable 'results we want' but that gave issues with the text values. So then I moved it just to the 'images' value as this is the only one that is coming back as an array from this call. Full video is below.
Detailed Reproduction of Problem: https://share.cleanshot.com/VP6EfX
Data source: https://dummyjson.com/docs/products
Best Answer
-
Hey @Vadim Vozmitsel you're getting this error message because loops only work with (numerically indexed) arrays. You are looping through result which is an object.... I suspect you actually want to loop through your products array
Answers
-
@Michael Udinski Hi Michael, yes, thank you very much for the clarity here. I was able to get everything going by appending '.products' to the variable 'returned_products.response.result.products'.
🙂
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