How to extract a certain number of objects from an array
Options
Tami
Member ✭
Hi everyone,
So I have an external API request which returns an array as the result/response. The array has no definite number of objects in it. However I want to create a variable (an array as well) which would extract the first 3 objects from the response of the API request. I'm using the for each loop function but it just runs through all the objects and I can't seem to find a way to just take the first 3. Any help would be appreciated. Thank you.
Comments
-
You can use the "range" filter.
You can find the documentation here: https://docs.xano.com/working-with-data/data-type-filters/array-filter
For the first 3 object you can use it with start 1 and stop 3.
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