External API requests depending on the number of records returned in previous response
![aleksis](https://us.v-cdn.net/6037124/uploads/userpics/RER3LTV2CB05/nFLCNPYAL2XPL.png)
Hello,
I am struggling with adjusting my function stack to do external API requests depending on the number of records returned.
I have built an app that fetches bank account details. It is working fine with a single account
where first API gets the account number (if 1 account is returned it is fine):
and second API does a call using the account number (921cdef…) to the bank fetching account details like balance, currency, name, etc.
I am having problems when on first API multiple accounts are returned like this
it does not work because of dot notation both accounts are combined in a single line. I would need here to split the accounts one by one and do an external API call for each of the accounts depending of how many there are. It could be that the person has 1 ; 2 ; 5 or more accounts.
How can I create a function to "separate accounts one from the another and then do an external API request for each one to fetch account data"?
Or is there a better way how to do it?
Best Answer
-
For each loop and little bit of tweeking did the magic and I was able to resolve this.
Answers
-
Is it possible to do an external API call via "For Each Loop" function? Meaning, I'd like to do an external API call for each record in the array of accounts separately.
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